Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Flow should be triggered only from script

rambo1
Tera Guru

Hi Team,

I created a flow which created scrum tasks under story when story is created.

Trigger condition is when record is updated.

I have created a UI action from which I am calling this flow and its working as expected, but requirement is flow should work only when ui action is clicked.

SO is there any triggere condition for this scinario ?

Now when story is created and updated , flow is triggered and tasks are created but I want tasks to be created only when UI action story form is clicked.

1 ACCEPTED SOLUTION

Marco0o1
Tera Sage

Hi @rambo1 ,

 

Of course you can trigger a flow from a script, but you will need to use a subflow instead a flow, and pass your inputs[your record] when you are creating your subflow, then when you have created your subflow and you activated the subflow only copy the code and paste, there is a example:

 1 - Create your subflow and activate:

Marco0o1_0-1694125537483.png

2- Select your options and click "Create code Sniped":

Marco0o1_1-1694125593092.png

3- You would copy the code:

Marco0o1_2-1694125629632.png

4- Copy the code in your UI action and execute in your espected scenario:

Marco0o1_3-1694125893942.png

 

If you have any espected output like a record you can update the record or do any thing in accord with your necesities.

 

Hope that help you.

 

 

View solution in original post

1 REPLY 1

Marco0o1
Tera Sage

Hi @rambo1 ,

 

Of course you can trigger a flow from a script, but you will need to use a subflow instead a flow, and pass your inputs[your record] when you are creating your subflow, then when you have created your subflow and you activated the subflow only copy the code and paste, there is a example:

 1 - Create your subflow and activate:

Marco0o1_0-1694125537483.png

2- Select your options and click "Create code Sniped":

Marco0o1_1-1694125593092.png

3- You would copy the code:

Marco0o1_2-1694125629632.png

4- Copy the code in your UI action and execute in your espected scenario:

Marco0o1_3-1694125893942.png

 

If you have any espected output like a record you can update the record or do any thing in accord with your necesities.

 

Hope that help you.