Flow Designer: Getting value from table field for Payload Builder

Ken Berger
Giga Guru

Hi folks,

 

Working on a flow to create a remote incident for eBonding and I need to get the priority value as a number (1-4).  This is how it appears in the Incident table when I do "Show XML" on an incident.  When I add it as a Name:Value pair in the payload builder I am not getting that, but instead I am getting the value that is selected in the Choice List (which has also some extra text that we do not want).  I tried applying the "First Character" transform but this is crashing the flow because i do not think the input data is a string.  Can anyone suggest the way to get this value as the numeric that appears in the table?

 

KenBerger_0-1689012293301.png

 

Thank you,

Ken

1 ACCEPTED SOLUTION

Ken Berger
Giga Guru

I was able to solve it by creating a flow variable and adding the following code to pull the value for the variable:

var priority = fd_data.trigger.current.priority;
var ePriority;
if (priority=='5'){
ePriority = '4';
} else {
ePriority = priority;
} 
return ePriority;

The vendor will only accept 1-4.  I was able create an input on my "create remote incident" action and populate it with this variable.

 

Ken

View solution in original post

3 REPLIES 3

OlaN
Giga Sage
Giga Sage

Hi,

As you can see in the Data panel on the right side, the Priority is not treated as an Integer, but a choice.

To get the actual value, you'll need to do a little inline script to retrieve the value.

Example below:

var prioValue = fd_data.your_action_that_contains_the_incident_data.priority.toString();
return 'Priority is: ' + prioValue;

Hi OlaN,

 

Thanks for your reply.  Where do I add the inline script?  I have created a Flow Variable called priorityValue.  Is this where I add the script?  If so, how?

 

Thanks,

Ken

Ken Berger
Giga Guru

I was able to solve it by creating a flow variable and adding the following code to pull the value for the variable:

var priority = fd_data.trigger.current.priority;
var ePriority;
if (priority=='5'){
ePriority = '4';
} else {
ePriority = priority;
} 
return ePriority;

The vendor will only accept 1-4.  I was able create an input on my "create remote incident" action and populate it with this variable.

 

Ken