Our store procedure on DB returns me list of Dictionary and it has over 50 columns. Before I return this to user in gridfield how to get subset of columns from that List of Dictionary? In other words i need new list of Dictionary with just a few columns. for example extract columns {"Amount", "id").
I'm using version 20.1
Discussion posts and replies are publicly visible
a!forEach( local!listOfDictionary, { Amount: fv!item.AMOUNT, id: fv!item.ID } )
I am not sure why you want to remove the fields? The grid field is displaying the data. And it will only show the fields you want.
Here is the bigger picture.
Stored procedure executed from expression view takes around 13-14 seconds and return 54k records and over 50 columns.
All data are assigned to data property of GridField and only 10 columns are displayed. List of columns to be display will be defined by user. For each column we are using index over fv!row to check whether that column exist.
From end user perspective (chrome) we can see that loading data (30 rows as pageInfo) takes much more time. when we checked the Network tab on chrome developers tools getting 'report' takes 20+ seconds to what it takes to get data from db. Our main goal is to optimize this and force Appian to show data faster as it is only 30 rows per page, 10 columns.
for testing we have simplified the view and show only once single column (id) in grid field and it still takes 10+ just to diplay grid with single column and 30 rows out of 54k rows.
OK, your stored procedure takes > 10 seconds. Does it support paging? How frequently is it called?
it is called by multiple users 5-6 times per hour (for different clients).
I haven't seen any implementation of stored procedure that support paging. Store procedure accepts a few parameters but we don't sent any paging information.
OK. Then it might be a good idea to add that.
For me it feels OK when Appian renders the interface within 13-14 second if the procedure already takes more than 10.
To speed that up, you will need to rework the procedure.