- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-21-2025 08:11 AM - edited 03-21-2025 08:12 AM
Hi All,
I need assistance understanding how lookups work in Flow Designer.
Essentially, I need to:
1. Look up all the account records where "status" is "open"
2. For each of those accounts, lookup all "general cases" records where "active" is true and "account" matches each of the accounts found in the previous lookup.
3. If "status" of lookup in step 2 is "Success" (ie there are active cases associated with any of the accounts), then update all the cases associated with each account returned and update the work notes with any comments.
4. If "status" of lookup in step 2 is "error" (ie no active cases), then perform another lookup on the customer_contact table for each of the accounts from step 1 to see if there's a contact associated with the returned accounts.
5. If "status" lookup in step 4 is "success" (ie there is a contact), do nothing.
6. If "status" lookup in step 4 is "error" (ie there is no contact), then create a new general case for each of the accounts returned.
Thank you in advance
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-21-2025 09:19 AM
this should help.
I believe I have answered your question and you can take it from here
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-21-2025 08:23 AM
What have you tried so far? Can you share a screenshot of your flow?
Also a few other questions... can a user have multiple "general case" records? Or only one?
It looks like you would need to have a few flow actions for "Look up records" and then a "For each" loop. Something like the below.
- Look up records on Account table where Status is Open
- For Each (Data Pill: Look up Records) Account that is Found
- Look up records on the General Cases table where active=true and general case account field=Account
- If Look Up Records Count = 0
- Look up records on Customer Contact where account=account
- If Look Up Records Count = 0
- Create new general case
- Else if Look Up Records Count > 0
- End flow
- If Look Up Records Count = 0
- Look up records on Customer Contact where account=account
- Else if Look Up Records Count > 0
- If record status = Success
- Update record
- If record status = Success
- If Look Up Records Count = 0
- Look up records on the General Cases table where active=true and general case account field=Account
- For Each (Data Pill: Look up Records) Account that is Found
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-21-2025 09:27 AM
hi @jcmings yes it will be each case created for every account found. I tried what you suggested but didn't work. It will be similar to what Ankur shared below(see image below), but I think the "count" conditions you mentioned above didn't work.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-21-2025 08:25 AM
Something like this will help you and you can enhance it further
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-21-2025 08:55 AM
something like this, please enhance
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader