I have the following record:
Source = [
Properties = [
steps = {
[
index = {
[
display = "Something",
data = "data2"
]
},
access = "Column1"
],
[
indices = {
[
display = "Something else",
data = "data2"
]
},
access = "Column2"
]
},
opt = [
key1 = "val1",
key2 = "val2",
key3 = "val3"
]
]
]
I am updating/adding a new field inside the nested record. However, after that I am unable to get the reference to the original record with the modified field.
Here is the M code for the change. I am adding a new field updatedKey3 which contained the capitalized key3 field and then I am removing the key3.
let Source = [
Properties = [
steps = {
[
index = {
[
display = "Something",
data = "data2"
]
},
access = "Column1"
],
[
indices = {
[
display = "Something else",
data = "data2"
]
},
access = "Column2"
]
},
opt = [
key1 = "val1",
key2 = "val2",
key3 = "val3"
]
]
],
step1 = Source[Properties][opt],
step2 = Record.AddField(step1, "updatedKey3", Text.Upper(step1[key3])),
step3 = Record.RemoveFields(step2, {"key3"})
in
step3
step3 returns the record:
[key1 = "val1", key2 = "val2", updatedKey3 = "VAL3"]
However I want this change within the Source record and view it completely. Any help would be appreciated.