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
  • In continuation to my previous reply....... I am trying to implement a grid which can dynamically create columns based on the data of a single column returned by DB. To explain more preciously, I am getting below table data for Code=xyz. The given dataset contains the complete data I need to show in the grid, however the 'Detailed' column has the set of columns and it's value which I need to split and show in my final grid along with other columns.

    Code          col2           col3           Detailed                                        col6
    xyz                    asdfsa          ad                    col4~asd|col5~uwu                    adf
    xyz                    er                    we                    col4~ut|col5~uu           cwe
    xyz                    qqw                    rr                    col4~co|col5~uw                    asdfw

    The Detailed column contains the columns separated by '|' and every column name and it's value is separated by '~'. Other than this I also have the details of columns set (name) for given Code=xyz, which is suppose to be different for different Codes (in this case it is "col4", and "col5" for Code=xyz).

    Once I retrieve all the columns from 'Detailed' column, appian should show the grid with following details.

    Code          col2           col3           col4           col5           col6
    xyz                    asdfsa          ad                    asd                    uwu                    adf
    xyz                    er                    we                    ut                    uu                    cwe
    xyz                    qqw                    rr                    co                    uw                    asdfw

    I am trying to implement this with the help of gridTextColumn and gidField, however I find it difficult to prepare the data in the format which gridField expects for this.

    Thanks for the help!
Reply
  • In continuation to my previous reply....... I am trying to implement a grid which can dynamically create columns based on the data of a single column returned by DB. To explain more preciously, I am getting below table data for Code=xyz. The given dataset contains the complete data I need to show in the grid, however the 'Detailed' column has the set of columns and it's value which I need to split and show in my final grid along with other columns.

    Code          col2           col3           Detailed                                        col6
    xyz                    asdfsa          ad                    col4~asd|col5~uwu                    adf
    xyz                    er                    we                    col4~ut|col5~uu           cwe
    xyz                    qqw                    rr                    col4~co|col5~uw                    asdfw

    The Detailed column contains the columns separated by '|' and every column name and it's value is separated by '~'. Other than this I also have the details of columns set (name) for given Code=xyz, which is suppose to be different for different Codes (in this case it is "col4", and "col5" for Code=xyz).

    Once I retrieve all the columns from 'Detailed' column, appian should show the grid with following details.

    Code          col2           col3           col4           col5           col6
    xyz                    asdfsa          ad                    asd                    uwu                    adf
    xyz                    er                    we                    ut                    uu                    cwe
    xyz                    qqw                    rr                    co                    uw                    asdfw

    I am trying to implement this with the help of gridTextColumn and gidField, however I find it difficult to prepare the data in the format which gridField expects for this.

    Thanks for the help!
Children
No Data