How to get ALL variables of a requested item in flow designer?

Smith Johnson
Kilo Sage

Hello,

I have created a custom action in flow designer, where one of my inputs is the variables of the submitted catalog item in string.

SmithJohnson_0-1780500503690.png

 

Since this is an action used across many catalog items, I want to take automatically the variables associated with the submitted catalog item.

Therefore, I tried to use the following code but it doesnt work:

return String(fd_data.trigger.request_item.variables);

Any ideas?

Thank you,
Smith.
1 ACCEPTED SOLUTION

Brad Bowman
Mega Patron

A better approach may be to use the requested item / trigger record as the single input to the custom action.  In the action this would look like

BradBowman_0-1780510551077.png

Then in the script in the custom action you can get the variables, then loop through them using something like this:

    var ritmVariables=inputs.ritm.variables.getElements();
    ritmVariables.forEach(function(grvariable){

 

 

 

View solution in original post

2 REPLIES 2

Brad Bowman
Mega Patron

A better approach may be to use the requested item / trigger record as the single input to the custom action.  In the action this would look like

BradBowman_0-1780510551077.png

Then in the script in the custom action you can get the variables, then loop through them using something like this:

    var ritmVariables=inputs.ritm.variables.getElements();
    ritmVariables.forEach(function(grvariable){

 

 

 

This helped a lot, thank you 🙂