Forum Discussion

Mic1979's avatar
Mic1979
Post Partisan
1 year ago
Solved

Record.TransformFields error

Dear all,   I am trying to understand how to use some functions to replace value in a table with the records. This is the function I am speaking about. I have a record defined in the function nam...
  • AlienSx's avatar
    AlienSx
    1 year ago

    Hello, Mic1979 first of all, what problem are you trying to solve: the one in #1 or #6? I am lost. Lets take #6 (the one with tables). You are using wrong function/approach to transform column(s) values. Why Table.TransformRows and Record.TransformFields? There is Table.TransformColumns function. 

    I suggest that using record + Record.FieldOrDefault for a replacements is the "structure" you are talking about. Nothing wrong with it. It's the way you choose to apply it looks strange to me.

    Okay, so be it - it's your decision. In my last message I just pointed out that list of column names (or list of single column name) should not be passed as table[column] as you suggested but as {"name1", "name2"} etc. Then you can easily setup transformations for Table.TransformColumns in the form of {{"name1", function1}, {"name2", function2}}

    And even your current code works just fine if you pass {"Region"} instead of Starting_Table[Region] as you did.