Copy all Fields is a Script Component that automatically copies multiple values from one form to multiple form fields in another form.
This is useful for automating steps in process applications when a total copy of all values in a form to another is required.
NOTE: In order to Copy all Fields, the receiving form must have the same field names and be of the same field type as the particular field names in the form you wish to copy values from.
Only fields with corresponding field names and types will receive new values when Copy all Fields are performed.
Add the Copy all Fields component to a process
- Open the Component section in the left panel of the modeller
- Drag and drop the component Copy all Fields onto your canvas.
- Close the configuration window, add the new Script Task to your model and connect all Form Templates and Data Objects you want to set and get values to and from.
NOTE: The Form Template or Data Object you wish to copy from must be an input while the Form Template or Data Object you wish to copy to must be an output. It is possible to have several inputs in which case you must select from which Form Template or Data Object from a dropdown list in the Configure script settings. There can only be one output from a script task.
- Open the script task settings and click on Configure scripts to open the configuration view.
- Choose what Form Template or Data Object you would like to copy data from and make sure you've connected the recipient form as an output. Furthermore, chose if you want to Overwrite existing values or not.
- Click on Save.
How to copy multiple fields to a single form in the same Script Task
If you want to copy form fields from more than one source to the recipient form, drag and drop one or more additional Script Components from the Component section in the Asset Browser onto your existing Script Task and configure your second script component which can be found under the first one on the left side of the Configure script panel. Just make sure the field names correspond in the receiving form with the field names in the forms you wish to copy data from.
NOTE: You can also drag and drop the Script Component onto an already existing Task in your process to transform it to a Script Task with the Script Component set on it. Note however that a script task can only ever be a script task and that any functionality the task originally had will not be available.