- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-09-2024 11:02 AM
I have a flow that I want to have an interaction programmatically. Its trigger is a service catalog. It doesn't have inputs as the service catalog is the input itself.
I'm using this API ref: https://docs.servicenow.com/bundle/xanadu-api-reference/page/app-store/dev_portal/API_reference/Scri...
When a flow has no inputs but gets triggered by a service catalog. How do I pass the service catalog object as a parameter?
The documentation only includes inputs. Nothing for service catalog trigger.
I tried to pass a glidrecord object as an input but I get a datatype mismatch.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-11-2024 12:04 PM
I have figured out the solution:
var grIncident = new GlideRecord('sc_req_item');
grIncident.get('6a173ae41b9c8e901c8f6570604bcb00');
var inputs = {};
inputs['request_item'] = grIncident;
var result = sn_fd.FlowAPI.getRunner()
.flow('x_gup_ansible_inte.new_server_build')
.withInputs(inputs)
.inForeground()
.run();
gs.info(result.debug());
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-09-2024 11:34 AM
can you elaborate more on the requirement? Do you want to run a flow on specific table record or trigger a flow for requests?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-09-2024 11:52 AM
Thanks for your reply. Basically, I have a Flow that gets run on a new item for service catalog. So its trigger is a service catalog. Within that flow, I have actions that reads the trigger and modifies the trigger as well.
So then when I run the flow through a serverside script (from the API reference the I linked). My steps fail because I'm not able to specify a service catalog item via API.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-09-2024 12:02 PM
Why do you want to modify the trigger within the flow. Do you want to generate a request from another catalog item programmatically?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-09-2024 12:08 PM
I'm not looking of modifying it. I want to run a flow programmatically. I want to feed it with a catalog item for trigger. .