I have a requirement to copy data from one user form to another.
If a user has made one order, it is saved in the database. I need a functionality where I can use the saved order's data to be copied to another form. Does anyone know how can I achieve this functionality?
Example would be very helpful.Thanks
Discussion posts and replies are publicly visible
In Appian there is no thing like "copy data from one form to the other". Can you explain in detail what you are trying to achieve?
According to my requirements, I should be able to use saved data from one form to another. Like if a user has submitted one order and later on they want to use the same details for another order. so they should have the ability to use that data to auto-fill all the forms.
Assuming you follow the normal way of designing Appian apps, you have a record that you want to duplicate. Then, just create a related action that fetches the required data, nullifies all the identifiers and shows that data in a form.
That would be the most simple and direct way.
I need to have a 'copy' button somewhere on the form
Can you elaborate more? I am still confused about the option
I still have no clue what you are trying to do !?!?!
Add a a!recordActionField to your "form" to allow the user to initiate the related action you might have created.
so when user click on copy button user should get option to fill previously submitted orders to this form.
Tan18 said:so when user click on copy button
There is lots of magic you can do using the a!save() function inside the saveInto parameter of many component types (especially buttons). For instance you could allow the user to select an existing record (which you've queried onto a form, perhaps in a grid), then press "COPY", and when that is pressed, copy the values field-by-field into a new/blank local variable (with cleared-out primary identifiers as Stefan mentioned), and fill in further details / changes as needed.
How can I clear out primary identifiers. Do you have any examples to share?
Set set the fields to NULL using a!update(). For lists, use a foreach.