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,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.