- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Sunday
Hello,
I created flow to auto close any ticket opened 6 months ago, the flow run midnight. I need to send an email to the business with the list of all tickets that has been auto closed. the issue is the flow sending email even if action #3 didn't run.
I am not sure how to get action #4 to run only if there was close ticket from action #3. Below is my flow
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Sunday
Hi @sparkles ,
you can use count data pill from the lookup records action
if it's greater than 0 then send the email
Please mark my answer as helpful/correct if it resolves your query.
Regards,
Chaitanya
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Sunday
Hi @sparkles ,
you can use count data pill from the lookup records action
if it's greater than 0 then send the email
Please mark my answer as helpful/correct if it resolves your query.
Regards,
Chaitanya
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Sunday
Hello @sparkles ,
If you expand the step 1 in your flow, there is a checkbox called Don't fail on error , you need to check that field and before step 2 add If condition which checks the drag the data pill of the step 1 status message is sucess or not
It the step 1 status message is success then only perform step 2 ,step 3 and step 4 else end flow.
If my response funds helpful, please mark my response as helpful and access the solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Sunday
approach shared by @Chaitanya ILCR should help you
Use that and share feedback
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Monday
Hi @sparkles !!
Issue:
The flow sends an email even when no tickets are closed.
Reason:
In Flow Designer, the For Each action is considered successful even if the Look Up Records action returns 0 records. Because of this, the flow continues to the Send Email action regardless of whether any records were updated.
Solution:
Add an IF condition to check whether any records were returned before sending the email.
Steps:
Use the Record Count output from the Look Up Records action.
Add an IF condition after the For Each loop.
Configure the condition as:
Look Up Records → Record Count > 0Move the Send Email action inside the IF block.
Flow structure:
Trigger (Daily)
→ Look Up Records
→ For Each Item
→ Update Record (Close Ticket)
→ IF Record Count > 0
→ Send EmailResult:
The email will be sent only when at least one ticket is auto-closed, preventing unnecessary notifications when no records are updated.
Mark this as Helpful if it clarifies the issue.
Accept the solution if this answers your question.
Regards,
Vaishnavi
Associate Technical Consultant
