HTML With Conditional Display Of Merge Fields

In this guide, we will be using HTML field with merge fields which are rendered based on some condition. This is auto rendered when value changes based on field in condition.

Drag and drop a Salesforce Lookup, two Salesforce Prefill, two Text, two Number, an HTML and two Multiple Fields Per Row (optional) fields.

Rename the Text and Number fields as shown below.

image
image
image

Click the pencil icon of the Salesforce Lookup. Change the Label, select Object and Display additional fields, and set Record Filter. Save the changes.

image

Click the pencil icon of the first Salesforce Prefill field. Change the Label, and set the Object, Formyoula Parent Field and Salesforce Parent Field.

image

Map “Form Fields” to “Object Field”. Save the changes.

image

Click the pencil icon of the second Salesforce Prefill field. Change the Label, and set the Object, Formyoula Parent Field and Salesforce Parent Field.

image

Map “Form Fields” to “Object Field”. Save the changes.

image

Click the pencil icon of the HTML field and paste the code. Save the changes.

image

Please use the below code:

<!--{{#compare 489e-018d-e1b6 '' operator='!='}} -->
<ul class="list-group">
	<p>Product present</p>

<!--{{#if 979d-87b3-d98a}} -->
	<li class="list-group-item list-group-item-primary">{{979d-87b3-d98a}} Present with quantity {{48e8-19c9-bdf5}}</li>
<!--{{/if}} -->

<!--{{#if c5ad-babe-2e44}} -->
	<li class="list-group-item list-group-item-secondary">{{c5ad-babe-2e44}} Present</li>
<!--{{/if}} -->
</ul>
</br></br>
<ul class="list-group">
<!--{{#if 979d-87b3-d98a}} -->
  <li class="list-group-item d-flex justify-content-between align-items-center">
    {{979d-87b3-d98a}}
    <span class="badge badge-primary badge-pill">{{48e8-19c9-bdf5}}</span>
  </li>
<!--{{/if}} -->
<!--{{#if c5ad-babe-2e44}} -->
  <li class="list-group-item d-flex justify-content-between align-items-center">
    {{c5ad-babe-2e44}}
    <span class="badge badge-primary badge-pill">2</span>
  </li>
<!--{{/if}} -->
  
</ul>

<!--{{/compare}} -->

Please change the field IDs as per your form.

image

Additionally, you can use the “Multiple Fields Per Row” field to show more than one field in a single row.

image

Try the form.

image

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

Example Form.json10.9KB