In this blog post, we will explore the procedure to reset field values of repeatable sections within Formstack for Salesforce forms. By integrating custom JavaScript code, users gain the capability to erase field values within the repeatable sections of Formstack for Salesforce forms. When crafting a form and choosing the ‘Repeating’ option while incorporating a related Salesforce object, the linked Salesforce objects become available for the repeatable section.
![Form Settings (Object Selection)](https://www.greytrix.com/blogs/salesforce/wp-content/uploads/2024/01/1.-Form-Settings-Object-Selection.png)
By default, repeatable sections retain information from the initial entry.
![Default Repeatable Section](https://www.greytrix.com/blogs/salesforce/wp-content/uploads/2024/01/2.-Default-Repeatable-Section.png)
Steps to add JavaScript code to reset field values of repeatable sections in Formstack
Note: Formstack package should be installed in your org.
- Create Formstack form on Salesforce org, drag and drop the Salesforce object fields on the form.
![New Formstack form](https://www.greytrix.com/blogs/salesforce/wp-content/uploads/2024/01/3.-New-formstack-form.png)
- To add JavaScript code find the ‘form settings’ and find the ‘JavaScript Code’ option, at the bottom of the form settings to reset field values of repeatable sections in Formstack.
![Form Settings](https://www.greytrix.com/blogs/salesforce/wp-content/uploads/2024/01/4.-Form-Settings.png)
- Next, add the following code to remove field data from repeatable section and reset field values of repeatable sections in Formstack.
![reset field values of repeatable sections in Formstack](https://www.greytrix.com/blogs/salesforce/wp-content/uploads/2024/01/5.-Javascript-Code.png)
- After adding the JavaScript code next step is to publish the form. To publish the form, click on the Publish Draft button and then click on ‘Publish Options’.
![Publish Draft](https://www.greytrix.com/blogs/salesforce/wp-content/uploads/2024/01/6.-Publish-Draft.png)
- In ‘Publishing Options’ select ‘Hosted form’ tab and click on form link to reset field values of repeatable sections in Formstack.
![Hosted Form Link](https://www.greytrix.com/blogs/salesforce/wp-content/uploads/2024/01/7.-Hosted-Form-Link.png)
- Lastly check the blank field value of repeatable sections.
![Blank Repeatable Section](https://www.greytrix.com/blogs/salesforce/wp-content/uploads/2024/01/8.-Blank-Repeatable-Section.png)
By following the above blog instructions, you will be able to learn How to reset field values of repeatable sections in Formstack for Salesforce forms“
More details about the product are available on our website and Salesforce AppExchange.
We hope you may find this blog resourceful and helpful. However, if you still have concerns and need more help, please contact us at salesforce@greytrix.com.
Related Posts