Query Filter is not working as expected

Hi Team,

we have modified a field (lobId) from normal to an array type (highlighted below)

In an interface, I'm getting the following error:

The error I'm getting at the following code.

line_of_business: if(
          isnull(
            local!line_of_business
          ),
          if(
            rule!APN_isEmpty(
              tostring(
                index(
                  local!userlist.data,
                  "lobId",
                  {}
                )
              )
            ),
            {},
            tostring(
              rule!CTR_QE_getLineOfBusinessById(
                lineOfBusinessId: tointeger(
                  tostring(
                    index(
                      local!userlist.data,
                      "lobId",
                      {}
                    )
                  )
                )
              ).data.line_of_business_code
            )
          ),
          local!line_of_business
        ),

If i send the values manually like below, its working as expected.

line_of_business:  {"RBWM","GBM"},

My assumption is the above data is taking as an single string due to that I'm getting the error.

Note: I have modified the above code by keeping touniformstring too.. Still null data is going without any error.

Please help me in this.

  Discussion posts and replies are publicly visible

Parents
  • My issue got resolved by modifying the code as below

    a!forEach(
              items: local!userlist.data.lobId, 
              expression: if(
                isnull(
                  local!line_of_business
                ),
                if(
                  rule!APN_isEmpty(
                    tostring(
                      fv!item
                      /*index(*/
                        /*local!userlist.data,*/
                        /*"lobId",*/
                        /*{}*/
                      /*)*/
                    )
                  ),
                  {},
                  tostring(
                    rule!CTR_QE_getLineOfBusinessById(
                      lineOfBusinessId: tointeger(
                        tostring(
                          fv!item
                          /*index(*/
                            /*local!userlist.data,*/
                            /*"lobId",*/
                            /*{}*/
                          /*)*/
                        )
                      )
                    ).data.line_of_business_code
                  )
                ),
                local!line_of_business
              )
            )

Reply
  • My issue got resolved by modifying the code as below

    a!forEach(
              items: local!userlist.data.lobId, 
              expression: if(
                isnull(
                  local!line_of_business
                ),
                if(
                  rule!APN_isEmpty(
                    tostring(
                      fv!item
                      /*index(*/
                        /*local!userlist.data,*/
                        /*"lobId",*/
                        /*{}*/
                      /*)*/
                    )
                  ),
                  {},
                  tostring(
                    rule!CTR_QE_getLineOfBusinessById(
                      lineOfBusinessId: tointeger(
                        tostring(
                          fv!item
                          /*index(*/
                            /*local!userlist.data,*/
                            /*"lobId",*/
                            /*{}*/
                          /*)*/
                        )
                      )
                    ).data.line_of_business_code
                  )
                ),
                local!line_of_business
              )
            )

Children
No Data