Basically im developing a start form where i get a list of records that contain a a docID and a dropdown.
The interface has a editable grid where the user can add rows and per row the user can add a document (file uploadField) and a dropdown.
My issue is that on both fields i selected the value and the save with ri!VALUE and when i add a document it makes it so that in all the rows that document is selected and the same for the dropdowns.
How can i make that per row created the save and the value creates a new array? In the interface i have already selected the ri! as multiple.
ill leave the code here , and thanks in advance to all,
Discussion posts and replies are publicly visible
The main issue here is in your overall structure. It's a clever idea to try to hold your rows in local!rowsTemp, but (at least as it's currently structured) it won't work - and may not be possible at all, though I haven't really tried to see if there is a way (if there were a way to get this structure to work though, it would involve some much more complicated code).
The reason here is that the save target in the original "rowsTemp" ends up being identical to the save target in any subsequent addition.
The way you're SUPPOSED to structure an editable grid is, in the "rows:" parameter, you should use a!forEach() to iterate over all items in your current data set (it can be a local variable or a rule input, but it should *always* be an array), because then each iteration (i.e. "fv!item[record.docId]") will point to a discrete data point.
I understand what you are saying and thanks for your comment! The problem is that the ri! is a record that is empty so if i try to do as you are saying ill have the same issue, no?
when selecting the dinamicLink a new row will appear but the save and the value will be traced to the same place..
Please follow this example:
https://docs.appian.com/suite/help/25.2/recipe-add-edit-and-remove-data-in-an-inline-editable-grid.html
Your idea will not work.
baltazarC said:The problem is that the ri! is a record that is empty so if i try to do as you are saying ill have the same issue, no?
no - a!forEach() returns an array of zero items when the source target is empty. all you need to do is set your "add row link" to append an empty row to the (empty array) RI value.
thanks for both of your answers. thats exactly what im doing but still the docID is being saved on all the arrays of the ri!
and with that when i upload a file on the firts uploadFile i get it on all the upload Files
or better, what would you insert in the save and value of the objects in those same rows? thanks
baltazarC said:what would you insert in the save and value of the objects in those same rows?
You shouldn't be inserting objects, you should just be inserting data rows in your data target. The main "row contents" array will contain the components you need and do that work for you.
The example code in the link already posted by Stefan demonstrates this pretty clearly:
thank you!
np - if you've figured it out, let us know - plus me and/or stefan would definitely appreciate a "verify" when you get a chance