api.prompt.render()
method:
ap_pUMG...
or select it from the Form editor Render tab.
In the Actions Code editor, you can define the business logic to decide when and how to render the Form.
fields
property as a second argument in your render method.
In the example below, the value Jane
populates first_name
field.
ID
referenced in the second argument is available client-side in your nodes and components; otherwise, the value will not populate.vars
property as a second argument in your render method. This can be used to inject sensitive information without exposing it to the client-side.
In the example below, the value 123456789
populates the variable external_user_id
.
{{vars.*}}
do not have data type restrictions.Shared variables {{vars.*}}
are always automatically masked.Unlike when populating {{fields.*}}
variables, the {{vars.*}}
property does not need to exist in your form before injecting values.You can use the {{vars.*}}
property to reference shared variables in your Forms and its linked Flows. To learn more, read Variables.event.prompt
in the resume function of the current action:
id
property, with the prompt ID you’re rendering.fields
object, which contains all your fields and hidden fields data.vars
object, which contains all your shared variables data.Example of event.prompt object
api.user.setUserMetadata
populates the user_metadata
company_name
attribute with the event.prompt.fields.company_name
property that was collected from your form.
post-login
trigger with two Actions, you can not render the same form in both Actions, you need to create different Forms for each Action.
fields
property size limit is 24 KB.
api.prompt.render()
method is available in the following triggers: