- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-02-2023 07:59 AM
Hello,
I would like to trigger a flow on Flow Designer, after a specific field on a RITM is updated.
I checked the available triggers on Flow Designer, but there is not one for updated records on sc_req_item table.
How could I set up a trigger for my use case?
It needs to satisfy the following:
field "X" updated on a record of the "sc_req_item" table
Thank you in advance for you ideas,
Smith.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-03-2023 03:17 AM
Unfortunately, what you mentioned does not work in my case, since the Catalog Item itself is bound to a workflow. This means that when the Item is requested, the workflow is triggered. But in any case thank you so much for your time and your ideas 🙂
However, I found the solution. I put it here in case someone needs it in the future.
The solution was to create a BR on the sc_req_item table with conditions to run for the specific catalog item and when the value of the field "X" changes. Then in the script, I used the following code:
(function() {
try {
var inputs = {};
inputs['table_name'] = 'sc_req_item';
inputs['request_item'] = current;
// Start Asynchronously: Uncomment to run in background.
sn_fd.FlowAPI.getRunner().flow('global.test').inBackground().withInputs(inputs).run();
// Execute Synchronously: Run in foreground.
//sn_fd.FlowAPI.getRunner().flow('global.test').inForeground().withInputs(inputs).run();
} catch (ex) {
var message = ex.getMessage();
gs.error(message);
}
})();
Where "global.test" is my flow that created in the Flow Designer. This flow has as trigger "Service Catalog".
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-02-2023 04:26 PM
This worked perfect for me. Thank you so much for sharing!