This guide will demonstrate how to display a combined list of Files and Attachments, allowing users to preview them when selected. This example combines all files into a single list to simplify this for the end users.
- Initial Setup:
- Drag and drop a “Salesforce Lookup”, a “JavaScript”, a “Hidden”, an “API Select List”, and a “Salesforce File Preview” field.
- Rename the fields as needed.
- Configuring The “Salesforce Lookup” Field:
- Click the pencil icon of the “Salesforce Lookup” field.
- Set “Object” as shown below.
- Configuring The “Java Script” Field:
- Click the pencil icon of the “Java Script” field.
- Paste the code.
- Please use this code.
- Please make sure to update the field ID’s as per your form.
- Configuring The “API Select List” Field:
- Click the pencil icon of the “API Select List” field.
- Enable the Select Picker View.
- Add the “Select Option Label Key” and “Select Option Value Key” as shown below.
- Disable the API Call ON Page Load.
- Add field ID in the “Local Data Field”.
- Here,
4fe2-6c2a-e5b5is the field ID of the “Hidden” field labelled “Combined File Records”.
- Configuring The “Salesforce File Preview” Field:
- Click the pencil icon of the “Salesforce File Preview” field.
- Set “Salesforce File Field” as shown below.
- Save the changes.
- Test Your Form:
- Try the form.
- Lookup an Account.
- The “Select File” field will display a combined list of Files and Attachments and a preview when selected.
[ Example ] Combined File Preview.json7.5KB
For any questions, please contact us - [email protected] or the Formyoula in-app chat. 🙂