I have a grid as below. The thing is it is populating the country(s) column wrongly. India should be in third row, Mexico should be 2nd row and Saudi Arabia and Bangladesh should be in first row. The data we are passing is stored in the local variables and rule input correctly. But something is going wrong with the code to populate the grid column value. The code for grid column to populate Country(s) is below. Please help me in storing the correct values in to the grid.
a!gridTextColumn( label: "Country(s)", field: "country_txt", data: if( rule!APN_isBlank(index(local!gridData, "data", {})), {}, tostring( sorttextarray( stringArray: stripwith( split( index( index(local!gridData, "data", {}), "country_txt", {} ), ";" ), " " ), isDescendingOrder: false() ) ) ) )
Thanks in advance.
Discussion posts and replies are publicly visible
Hi Pavitra,
Which version of Appian are you using, I see a!gridTextColumn instead of this you can use a!gridColumn in a! gridField, may it works.
Hi Pavitra,I believe you are extracting the complete data of 'country_txt' from the local!gridData, which is returning an array or multiple countries and that's why it is getting populated in a single row.This code considers the complete data (country_txt) as a value for a single row.
Have you checked out for,
1. Data is incorrectly defined, means of mapping mismatch or wrong decleration.
2. trying with a!gridcolumn()
3. data is correctly defined for the values or not.
That code line 7 and following is so weird. Why is this al necessary? The final problem comes from line 7 where you turn a list of items into a single string.