Custom action which queries a table, retrieves users and assigns them as the output

LiamWalby
Tera Contributor

We have a requirement for a specific approval scenario where it is primarily based on a users department. In essence when a user raises a request the flow/sub flow will take the Approval Group variable which will contain a default value of:
{
"type":"LOB",
"assignmentgroup":""
}

I have set the sub flow up to look for the "Type":"LOB" and if it passes to then look up the User record (Based on the Requested For) grab the users Department, and query a custom table we have created which contains the departmental approvers. The Custom table has two fields, Department and Users.

 

I have created a custom action for the department user query that does this however it is not outputting the users as I would expect. As you can see the "Approvers" remains empty

LiamWalby_0-1733314244811.png

LiamWalby_1-1733314304436.png


I need the action to retrieve the users defined in that custom table which match the incoming department (In this case HR) and assign them to the output in one way or another which can then be used in an Ask for Approval action.

1 REPLY 1

Sanjay191
Tera Sage

Hello @LiamWalby 
 One thing "Ask for approval" action always set reference record not a string so please make sure whenever you set output in custom action you need to create the output variable as a reference.  

Sanjay191_0-1733389491030.png

And also at the end you need to set the output variable from script output.


If my answer has helped with your question, please mark my answer as accepted solution and give a thumb up.
Thank You