Interpolate String
Description
This is a process node part that will safely interpolate text (ie resolve all variable constructions and create a text string complete with any HTML structures).
While this part has a wide variety of uses, two of the most common are:
- to safeguard any text input that could be used to execute malicious code
- to prepare dynamic text prior to printing to PDF
In Release 7.4 on, the part has the added feature of being able to run interpolation twice, on two different contexts (scope) which is useful when building a text string such as a query, and when the query base (fhir_query) and target value (_startvars.patient_ref.fhir_patient_id) are in different contexts, as in the example below.
Editor Fields
Field Name | Description/Use | Type/ Options | Mandatory/ Optional |
path | Enter the name of the data object where the result of the interpolation should be stored | data object | M |
content | Enter the variable name (or text) that needs to be interpolated, using the $(...) construction | text | M |
Ist Interpolation | |||
context | The scope or context in which to find the content variable. By default, the current application context is used, but when a specific context is named, the interpolation will only look at the data-objects inside the named context. |
text | O |
Escape $(...)-content (v7.4+) |
Check this box if your content includes $(..) variables that should NOT be encoded. If the content contains several interpolations only some of which need to be escaped, use the $(html(mytext)) construction to turn off escaping for specific variable. |
On|Off | M |
2nd Interpolation (v7.4+) |
This part can perform 2 step interpolation, which means that the result of the first interpolation is interpolated again. In the example below, interpolating $(main_context.caption) will return This is my name: Person X unless in the 2nd interpolation the Designer specifies the context as other_context.person1 Download the example project into your Designer to see this working. |
||
context | As above | text | O |
Escape $(...)-content (v7.4+) |
As above | On|Off | M |
Example Project
An example project containing a simple demonstration of the 1st and 2nd interpolation is available here.