How to trigger Flow Designer after a specific field on a Requested Item record is updated?

Smith Johnson
Tera Guru

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.

SmithJohnson_0-1677772654581.png

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.

 

1 ACCEPTED SOLUTION

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".

View solution in original post

5 REPLIES 5

This worked perfect for me. Thank you so much for sharing!