Calling sub-flow (flow designer) from legacy Workflow
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hello Friends,
I have already created a Flow designer to add details in a table. I am currently modifying a Workflow. I need to call a Sub-flow (flow designer) from my workflow ?
1. I tried using core activity Run sub-flow from Workflow.
2. I have added sub-flow inputs in Workflow in Has Inputs section through a code.
e.g. answer = {};
answer['user'] = 'sys_id';
answer['entitlement']='sys_id';
Both user and entitlement are inputs in sub-flow with reference data type.
But this gives error during execution of workflow in RITM.
Any idea to resolve this?
Any other approach to call Sub-flow from a Workflow?
Please help.
Your help will be appreciated.
Thank you,
Asmi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago - last edited 3 weeks ago
Hi @Asmita7,
Dont pass sys id as input for reference inputs, pass them as Glide Record Objects, as Flow takes Glide Record objects for references.
ex:
var gr = new GlideRecord('sys_user');
gr.get('ADD_YOUR_SYSID_HERE'); //pass sys id dynamically not in string or you can also add query instead of .get()
answer['user'] = gr;
Same for entitlement and any other reference input.
Doing this will resolve your issues.
Please Accept this response as Solution if it assisted you with your question & Mark this response as Helpful.
Kind Regards,
Ehab Pilloor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago - last edited 3 weeks ago
Thank you for your time @Ehab Pilloor
In case if I need to pass variable from RITM E.g. current.request.requested_for
What should be approach in this case ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago - last edited 3 weeks ago
you can pass variable as same type value as it is received. Only for reference, you pass Glide Record Object.
For Requested for, get GR object in script and pass it as input.
var gr = new GlideRecord('sys_user');
gr.get(current.request.requested_for.getUniqueValue()); //pass sys id dynamically not in string or you can also add query instead of .get()
answer['user'] = gr;
Please Accept this response as Solution if it assisted you with your question & Mark this response as Helpful.
Kind Regards,
Ehab Pilloor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago - last edited 3 weeks ago
Hi @Asmita7,
Did my responses help resolve your issue? If yes, you may mark the above response as Solution and helpful and close the thread so that community members may look it up .
If not, let us know if you are facing any errors in triggering subflow.
Regards,
Ehab Pilloor