Not able to populate data from nested CDT on grid

Hello,

 

I have array of CDT within CDT. When I'm trying to populate data from that array to grid column I'm getting blank value with index function.

CDT Structure:

 

Datasubset value:[ userAssignedRequestName="test",
      users=[userName=dc_creator, email=dc_creator@bankcorp.com, phone=410-858-8811, firstName=test User, lastName=, status=active, role=xxxx, lastUserAction=creator];
            [userName=dc_modifier, email=dc_modifier@bankcorp.com, phone=410-858-8812, firstName=test User2, lastName=, status=active, role=xxxx, lastUserAction=modifier]]; 

Below code is not returning user array:

  a!gridTextColumn(
                  label: "User Name",
                  field: "lastUpdatedUserId",
                  data: rule!REST_getLastUpdatedUser(
                    index(                           
                              local!datasubset.data,
                             "users",
                             {}
                           )                  
                        )
                   ),

above highlighted code is not returning users array. Can anyone faced this issue with nested CDT ?

inside rule rule!REST_getLastUpdatedUser I have logic to return particular user name.

  Discussion posts and replies are publicly visible

Parents
  • Hi

    This is what you have mentioned in one of your replies..

    "Below is the REST_getLastUpdatedUser. Input is users array and out put is userName text. This rule works fine independently."

     

    If you are expecting single text to be displayed as it is in grid you need to wrap it with curly braces.

     

    a!gridTextColumn(
    label: "User Name",
    field: "lastUpdatedUserId",
    data: {
                rule!REST_getLastUpdatedUser
                (
                    index(local!datasubset.data,"users",{})
                )
            }
    )

     

    Regards,

    Mayur Mondhe

Reply
  • Hi

    This is what you have mentioned in one of your replies..

    "Below is the REST_getLastUpdatedUser. Input is users array and out put is userName text. This rule works fine independently."

     

    If you are expecting single text to be displayed as it is in grid you need to wrap it with curly braces.

     

    a!gridTextColumn(
    label: "User Name",
    field: "lastUpdatedUserId",
    data: {
                rule!REST_getLastUpdatedUser
                (
                    index(local!datasubset.data,"users",{})
                )
            }
    )

     

    Regards,

    Mayur Mondhe

Children