How to add tasks created by flow designer to HR case embedded list?

Pavani131
Tera Contributor

Hi,

I have created a flow which works as--whenever a case is created for a service the tasks should trigger and should be added on that Case automatically when the trigger conditions are met.

The  tasks are not getting added to the Case unless a 'test' is run on the flow.

Any suggestions on how to solve this issue.
Thanks in advance.

1 ACCEPTED SOLUTION

Sandeep Rajput
Tera Patron
Tera Patron

Ah, I faced the similar scenario in the past when the flow was not triggering on creation of a record. This look like an issue from ServiceNow when the flow doesn't trigger on the record creation on its own. 

 

In order to fix this, I simply created a business rule which triggered the flow for me.

 

To trigger the flow via business rule follow the following steps.

1. First open the flow in the flow designer which you would like to trigger via the code. Open the more tab and click on Create code snippet

Screenshot 2023-04-10 at 9.35.50 PM.png

 

2. This will take you to a page where the code to call the flow is shown.

Screenshot 2023-04-10 at 9.37.20 PM.png

This is how you should configure your business rule.

 

Screenshot 2023-04-10 at 9.38.41 PM.png

Here is how you should configure the script field.

Screenshot 2023-04-10 at 9.40.13 PM.png

Once done, try creating a new case of the Direct Deposit Inquiry Service and this time the flow will get triggered for sure. 

 

Hope this helps. 

View solution in original post

5 REPLIES 5

Sandeep Rajput
Tera Patron
Tera Patron

Ah, I faced the similar scenario in the past when the flow was not triggering on creation of a record. This look like an issue from ServiceNow when the flow doesn't trigger on the record creation on its own. 

 

In order to fix this, I simply created a business rule which triggered the flow for me.

 

To trigger the flow via business rule follow the following steps.

1. First open the flow in the flow designer which you would like to trigger via the code. Open the more tab and click on Create code snippet

Screenshot 2023-04-10 at 9.35.50 PM.png

 

2. This will take you to a page where the code to call the flow is shown.

Screenshot 2023-04-10 at 9.37.20 PM.png

This is how you should configure your business rule.

 

Screenshot 2023-04-10 at 9.38.41 PM.png

Here is how you should configure the script field.

Screenshot 2023-04-10 at 9.40.13 PM.png

Once done, try creating a new case of the Direct Deposit Inquiry Service and this time the flow will get triggered for sure. 

 

Hope this helps. 

Pavani131
Tera Contributor

Hi @Sandeep Rajput ,thanks for your solution.

For me this Create Code snippet is read only.

Pavani131_0-1681189598455.png

 

@Pavani131 you need to activate the flow first then only the create code snippet option would get enabled.

 

Also, did you activate this flow earlier or it has never been activated in the first place. If it has never been activated before than activate it first, check if it triggers on the record creation or not and if it doesn't then only apply the business rule solution. 

 

Pavani131_0-1681189598455.png

Thanks @Sandeep Rajput , the flow was activated before also.Now I just changed the when to run the flow to Run on current and extended tables. And the issue is resolved now.

I have tried the above solution also-it worked as expected.

Thank you!!