Hi, 1)For below records or dataset, how can I replace "col4"

Hi,

1)For below records or dataset, how can I replace "col4" with a set of columns ("col41", "col42", "col43") dynamically in the records?
Input:
{
{col1: "dcgsdf", col2: "thstr", col3: 1, col4: "jtsjre", col5:56},
{col1: "asdg", col2: "jtrj", col3: 53, col4: "srtjgsf", col5:32},
{col1: "fdhd", col2: "dfhs", col3: 21, col4: "srtjf", col5:3},
{col1: "rae", col2: "DGAS", col3: 45, col4: "sjfgj", col5:0}
}

Output:

{
{col1: "dcgsdf", col2: "thstr", col3: 1, col41: "re", col42: "ad", col43: "sasd", col5:56},
{col1: "asdg", col2: "jtrj", col3: 53, col41: "sjgsf", col42: "erw", col43: "sadf", col5:32},
{col1: "fdhd", col2: "dfhs", col3: 21, col41: "tjf", col42: "asd", col43: "afsd", col5:3},
{col1: "rae", col2: "DGAS",col3: 45, col41: "fgj", col42: "sf", col43: "wewf", col5:0}
}

OriginalPostID-207581

OriginalPostID-207581

  Discussion posts and replies are publicly visible

Parents
  • I think what you need to do is fix the columns that don't change - col1, 2, 3 and 5 in your example - by "hardcoding" the columnconfigs - and then insert() the result of a couple of nested applys - the first apply would loop over the col4 data which has been split using the | symbol and return a column, then for each iteration of that apply you'll need another that loops over each element of that split data, splitting it again using the ~ symbol to get the values that need to be displayed.
Reply
  • I think what you need to do is fix the columns that don't change - col1, 2, 3 and 5 in your example - by "hardcoding" the columnconfigs - and then insert() the result of a couple of nested applys - the first apply would loop over the col4 data which has been split using the | symbol and return a column, then for each iteration of that apply you'll need another that loops over each element of that split data, splitting it again using the ~ symbol to get the values that need to be displayed.
Children
No Data