How to retrieve Variables from Record Producer in Flow listening on Case Table?

Larry Lau
Kilo Expert

In a lifecycle event, I have an activity configured with an HR Task for a user to submit a HR Service+Record Producer with a few variables.  I need to automate something with the variables in a Flow.  The Flow is triggered when a record updated in the corresponding Case table.   That is all working good.  

In the Flow designer, I tried using the "Get Catalog Variables" action but it doesn't work. It seems to only work if the trigger is set to Service Catalog and Catalog Item is used.  But I can't use Service Catalog nor able to switch to Catalog Item because HR Service impose that I use a Record Producer which produces a case record instead of request item.   

How do I read the variables from the case table? What options do I have to get back the variables after the fact?

1 ACCEPTED SOLUTION

Larry Lau
Kilo Expert

Found a way to do it using a script in a custom action.  You can return the value via the outputs object.  The input case must be produced by your record procedure. 

var caseId = inputs.case.sys_id;
var qa = new GlideRecord("question_answer");
qa.addQuery('table_name', 'IN', hr.TABLE_CASE_EXTENSIONS);
qa.addQuery('table_sys_id', caseId);
qa.query();
while (qa.next()) { 
  gs.info('Reading ' + qa.question.name + ' value ' + qa.getValue("value"));
}

View solution in original post

6 REPLIES 6

Larry Lau
Kilo Expert

Found a way to do it using a script in a custom action.  You can return the value via the outputs object.  The input case must be produced by your record procedure. 

var caseId = inputs.case.sys_id;
var qa = new GlideRecord("question_answer");
qa.addQuery('table_name', 'IN', hr.TABLE_CASE_EXTENSIONS);
qa.addQuery('table_sys_id', caseId);
qa.query();
while (qa.next()) { 
  gs.info('Reading ' + qa.question.name + ' value ' + qa.getValue("value"));
}

Not applicable

Hi Larry

I just finished creating a Flow for my Record Producer and was able to grab the variables just fine.

I set the Flow trigger as Incident Created. In my example below I then updated the incident fields & grabbed the Catalog Variables from the producer. The variables all showed up as pills on the right-hand side as expected. I was then able to use them throughout the flow. 

find_real_file.png

When I attempt this in the Paris Version, the variables are always blank when attempting to run the flow.

Did you get a resolution for this? I'm running into same issue.