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!

已提问 9 个月前62 查看次数
没有答案

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则

相关内容