Flow Designer - variables into SC_TASK description in format variable.label - variable.value

Pastupe
Mega Guru

Hello,

Im trying to build one process via flow designer.

Im stuck on how to add RITM variables into Cat Task description.

Any idea of how to do it in the flow designer?

In the workflow, I was able to do it and below code, but the question is how to achieve the same result via flow designer.

Catalog task should have all RITM variables with their label and value, example below

Requested For: Petr Pastuszek

Requested For - is variable label

Petr Pastuszek - is variable display value

/Petr

workflow.scratchpad.u_variables = '<b>Variables</b>: <br></br><br></br>';
var set = new GlideappVariablePoolQuestionSet();
set.setRequestID(current.sys_id);// RITM sys id. We can also use - current.getValue('sys_id')
set.load();
var q = set.getFlatQuestions();
var iter = q.iterator();
while (iter.hasNext()) {

var item = iter.next();
workflow.scratchpad.u_variables += item.getLabel() + ': ' + item.getDisplayValue() + "<br></br>"; // set variable value
}

1 ACCEPTED SOLUTION

Pastupe
Mega Guru

Solved.

As explained earlier, the goal was whenever there is new RITM inserted (for certain process), we want to auto copy/paste all RITM variables label and variable values into cat. task description.

Below is the solution. before implementing it, consider commenting row with gs.log.....

The solution was to create a new action with the below script. Input is RITM record. RITM sys id for this action 

/Petr

 

find_real_file.png

 

 

 

find_real_file.png

View solution in original post

2 REPLIES 2

Pastupe
Mega Guru

Solved.

As explained earlier, the goal was whenever there is new RITM inserted (for certain process), we want to auto copy/paste all RITM variables label and variable values into cat. task description.

Below is the solution. before implementing it, consider commenting row with gs.log.....

The solution was to create a new action with the below script. Input is RITM record. RITM sys id for this action 

/Petr

 

find_real_file.png

 

 

 

find_real_file.png

Hi, I'm playing with flow designer. I have a question.

I've created a flow triggered off a Service Catalog item. I've also been able to use the 'Get Catalog Variables' action to grab the variables from the Catalog Item in question, and use them as inputs to a custom Action I have created. 

I notice in your example here you have been able to get the sc_req_item record as an input. How did you do that?

Thanks