Forum Discussion
smpa01
3 years agoCommunity Champion
Assiginng Record Field Name Dynamically
Is it posible to assign the Record Field name dynamically.
I am currently getting an error.
let
fieldName = {"a","b"},
src=[fieldName{0}=1,fieldName{1}=2]
in
src
Thank you in advance
How about this?
let fieldNames = {"a","b"}, src=Record.FromList({1,2}, fieldNames) in src
3 Replies
- AlexisOlsonSuper User
How about this?
let fieldNames = {"a","b"}, src=Record.FromList({1,2}, fieldNames) in src - AlexisOlsonSuper User
Here's another method that's more in the spirit of your attempt but not at nice:
let fieldNames = {"a","b"}, src=Record.Combine( { Record.AddField([],fieldNames{0},1), Record.AddField([],fieldNames{1},2) } ) in src - smpa01Community Champion
Thanks AlexisOlson