How do I reference values from fields?

Modified on Mon, 26 Feb 2024 at 10:26 AM

You may want to create dynamic and more readable text by incorporating the values from form fields into a Formatted Text Component or in Notifications

Using String Interpolation

A popular example would be using the entered employee name, pay schedule, contract dates, and more in the text of a Contract Letter. All you need to do is reference the ID of the component using string interpolation. String interpolation is a powerful technique used in programming to embed values of variables or expressions directly within a string (aka text).

To use string interpolation, follow the steps below.

1. Select the Formatted Text Component or Notification you would like to add the values.

2. Use two hashtag characters (##) on each side of the component ID of the field you would like to reference in the space you would like the value to be placed. 

Or within the Notification Builder:

To check if this is working properly. Open your Debug view, enter a value in the referenced field, and check the Formatted Text to see if the value appears. In this example, you can see the corresponding highlight values that were entered into fields appear within the text where the string interpolation was entered.

Droplet Tip
Making the string interpolation bold really helps those values stand out!

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select atleast one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article