Forum Discussion
scottdk
2 years agoFrequent Visitor
Global and Local environment effect on Expression.Evaluate.
I am was completely confused about the inconsistent results I was getting from Expression.Evaluate while taking a deeper dive into learning about global and local environments in preparation for movi...
- 2 years ago
Hi scottdk,
As the example by AlienSx clearly illustrates, a record merge (or combination operation), will overwrite like named fields from the left operant with that of the right operant. See the docs here: Values, Record
[a = 1] & [a = 2] & [a = 3] & [a = 2]
//result: a = 2
AlienSx
2 years agoSuper User
So it's not using the first one it finds? It's more like the second one supercedes the first?
This is how records with the same field names are combined in M
rec_1 = [a = 1],
rec_2 = [a = 2],
combine12 = Record.Combine({rec_1, rec_2}), // [a = 2]
combine21 = Record.Combine({rec_2, rec_1}) // [a = 1]