- 1 Minute to read
- Print
- DarkLight
- PDF
How do I reference values from fields in my Formatted Text Component?
- 1 Minute to read
- Print
- DarkLight
- PDF
You may want to create dynamic and more readable text by incorporating the values from form fields into a Formatted Text Component. 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.
To use string interpolation, follow the steps below.
1. Open the HTML block of your Formatted Text Component by clicking the < > icon in the Logic section of your Properties Panel.
2. Use two hashtag characters (##) on each side of the component ID in the space you would like the value to be placed. You should then see a line in place of the value.
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.
<b>##componentID##</b>