Best answer

Use same trigger response for two dynamic input filelds

  • 8 July 2022
  • 1 reply
  • 30 views

Hi,

I want to know is there any possibility to use the same trigger response for two dynamic input fields? Basically, I want to achieve in one API call get the whole result, and use it in different places.

Example :- 

Trigger API response  - 

[
{
"Wid": 130,
"name": "prompt()",
"templates": [
{
"Tid": 555,
"name": "A_WITH_PROD"
},
{
"Tid": 554,
"name": "ADOCKA_TEM"
},
{
"Tid": 5551,
"name": "B_NO_PROD"
}
]
},
{
"Wid": 1307,
"name": "a2345678901234567890123456789012345678901234567890",
"templates": [
{
"Tid": 521,
"name": "V2 Template"
}
]
},
{
"Wid": 106,
"name": "another collection",
"templates": [
{
"Tid": 522,
"name": "Ada template"
},
{
"Tid": 5128,
"name": "another office"
}
]
}
]

 

Inside the action 

  1. First drop down
    I want to select one of “Wid”.
     
  2. Second drop down
    Based on above selected “Wid” need to list down all “templates” array and give access to user to select one of “Tid”

This is my use case. Please can someone help me on above matter? CLI version more beneficial to me 

icon

Best answer by GetUWired 12 July 2022, 22:59

View original

This post has been closed for comments. Please create a new post if you need help or have a question about this topic.

1 reply

Userlevel 7
Badge +12

Yes, you can make both of these input options. As far as i am aware, it can’t be done in 1 api call. 

In your cli input they would both reference the same resource file (listWIDS). 

INPUTS: 
{ key: 'wid', label: 'WID Selection', required: true, dynamic: 'listWIDS.Wid.name'},

{ key: 'template', label: 'Template Selection', required: true, dynamic: 'listWIDS.Tid.name'},

 

In reference file “listWIDS” you need to include a flag so that if bundle.inputData.wid exists rather than return the wid array you would return the template array where wid matches bundle.inputData.wid



One albeit rather odd way of doing it might be to store a stringified version of the needed contents from the object as the value to wid. Then when you users load the second input, you know you can just grab wid.templates as the dropdown values. 


That would look something like this in the UI which of course could be cleaned up a bit.