Skip to main content
January 13, 2022
Question

how to refresh data in a a!gridLayout

  • January 13, 2022
  • 8 replies
  • 0 views

as title the refreshalways:true for a a!gridLayout can't be realized as a!gridField, how to let data in a!gridLayout be refreshed?

    8 replies

    richardm900458
    January 13, 2022

    Hi immortal,
    a!refreshvariable is meant to be used with a local variable. and this data can be easily used in a gridfield or layout. The question is: what is your target?

    January 13, 2022

    how to do it? code example, thank you

    peter.lewis
    Employee
    January 13, 2022

    You can't save any values into variables that use refreshAlways: true. The reason for this is that this behavior means that your variable is refreshed with every interaction. So even if we allowed saving into the variable, it would immediately be refreshed after saving and you would lose your changes.

    Can you describe more about your use case (preferably with sample code and screenshots)? What is your goal? What have you tried?

    January 14, 2022

    I am creating a editable grid shows up list of files in a folder, there is a delete button on right sides of each of fv!item file, once delete the file, it could immediately disappear for that file name from the list, and also i am going to create an upload function button once finish upload it could be immediately shows up on the list which in the editable grid.

    Btw, to be honestly ask, is appian going to last long?

    peter.lewis
    Employee
    January 14, 2022

    In that case you don't need to use refreshAlways: true. Instead, just set up your grid so that when you click the remove button, it deletes the row in your list. This recipe shows how to add / remove data in a grid, and it doesn't require using refresh variables at all.