Display An Image And Hide The "Photo" Field If The "Text" Field Prefills With An Image URL

In this guide, we will explain how to display an image and hide the "Photo" field if the "Text" field prefills with an Image URL.

  1. Initial Setup:
  • Drag and drop a “Salesforce Lookup” field, a “Salesforce Prefill” field, a “Text” field, an “HTML” field, a "Photo” field, and a “Field Update Workflow” field onto your form.
  • Rename these fields as needed.
image
image
  1. Configuring The “Salesforce Lookup” Field:
  • Click the pencil icon of the “Salesforce Lookup” field.
  • Set “Object” and “Display Additional Fields” as shown below.
image
  1. Configuring The “Salesforce Prefill” Field:
  • Click the pencil icon of the “Salesforce Prefill” field.
  • Set “Object”, “Formyoula Parent Field”, and “Salesforce Parent Field” as shown below.
image
  • Map the “Text” form field to the “Photo URL” field.
image
  1. Configuring The “HTML” Field:
  • Click the pencil icon of the “HTML” field.
  • Paste the HTML code to display the image using the merge field.
image
  • Please use the below code.
  • Here “4950-bae1-a429” is the field ID of the “Text” field named “Prefill URL”.
<img src="{{4950-bae1-a429}}">
  • Set “Yes” for the “Enable Reload On Merge Field Changes” option.
image
  1. Configuring The “Field Update Workflow” Field:

  • Click the pencil icon of the “Field Update Workflow” field.
  • Set Rule Criteria to ‘Prefill URL || not equal to || ’.
image
  • Set Field Updates Success to ‘Attach a Photo || hidden || true’.
image
  • Set Field Updates Fails to ‘Attach a Photo || hidden || false’.
image
  1. Test The Form:
image
  • It will display the image and hide the “Photo” field if the “Text” is prefilled with a value.
  • Note: You can use a “Hidden” field instead of the “Text” field.
image

For any questions, please contact us - [email protected] or the Formyoula in-app chat. 🙂