- 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
03-02-2023 08:24 AM
You need to create a flow designer with trigger as servcie catalog
and then add a if condition saying state is inprogress for example to execute your actions.
If my answer solved your issue, please mark my answer as ✅Correct & 👍Helpful
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-03-2023 12:05 AM
Hello @priyasunku ,
as shown below, I can't put conditions on the trigger.
I think the service catalog trigger is activated when a new RITM is created.
However, what I want to achieve is to trigger a flow when a specific field (name it "X") is changed in a requested item.
Any further ideas?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-03-2023 12:15 AM
First inorder to create a RITM you need flow designer to be written on Service catalog
1. select trigger as service catalog
2. 'Get variables' action
3. you can create if condition and check if RITM state is inprogress for example
If my answer solved your issue, please mark my answer as ✅Correct & 👍Helpful
- 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".