Flow script to add 'previous' and 'next' buttons to a data grid in a user step

I want to make a user step with data grid have a previous/next button that would show for example 3 records per page.

I was wondering if you you can create a custom user step with a data grid and a previous/next button using the Novacura Flow scripting language.

Thank you :slight_smile:

Maybe something like this?
The +3 should be replaced by a variable so you can choose the amount of lines displayed.
Same goes for the 0 assigned to Startvalue.
On Back count Startvalue - X after filtering so the next iteration will count from the new starting point on Next Startvalue + X.
So basically execute the script step and then reset the StartValue to the β€œnew” starting point in an assignment step after. You could also make the X a variable the user can choose himself (save it in a uservariable). In this case you should always add a Min command with 0 so you don’t go into negatives when going back.

You should also add a condition on the Back button to only show if the StartValue is > 0. Hope this helps, let me know if you have questions.

Let counter = 0;
Let TempMyTbl = Empty(MyTbl);
Let Startvalue = 0; 

For item in MyTbl{
counter = counter +1;


If counter > Startvalue: 
Set TempMyTbl = TempMyTbl & item;

If counter >= Startvalue + 3: 
Break; 
}

Return TempMyTbl;
1 Like

Hi,
you could set page number (Page) to 1, set view per page (PerPage) to somehing, then have button increasing and decreasing page number (Page) by 1 and they each go to an assignement step which filters the table (Tbl) making a new table to be shown (TblToShow) in datagrid with: TblToShow = {take(skip(Tbl,(Page-1)*PerPage),PerPage)}

Example here:
Test8

Hope this helps!

B R
Ivan

Thank you so much everyone :slight_smile: It works perfectly.