Dynamic Dropdown Options on a Form View (Step-by-Step Guide)

0

Is there a way to have the options for a Dropdown form component be dynamic? I am just wanting to query for values that are specific to the authenticated caller and populate the dropdown options with those values.

I have a Lambda integration function which fetches the values from the external system and responds with the proper format for the options array (objects containing a label, description, and value). I've tried to set the array as a Flow/Contact attribute and add the JSONPath in the Sections JSON on the View block but it is complaining about the JSON being invalid.

Here is a little example snippet of what I provided for the dropdown configuration in the Sections JSON:

...
"Type": "Dropdown",
"Options": $.Attributes.dropdownOptions,
...

The dropdownOptions attribute just contains the formatted list of options. Here is an example of what it may be set to based on the Lambda response:

[
{"Description": "Honda Accord", "Label": "Honda Accord", "Value": "1"},
{"Description": "Ford Escort", "Label": "Ford Escort", "Value": "2"}
]

Any suggestions or thoughts would be much appreciated!

asked 8 months ago56 views
No Answers

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions