Help with lookup actions in Flow designer

Snowman15
Tera Expert

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

1 ACCEPTED SOLUTION

@Snowman15 

this should help.

I believe I have answered your question and you can take it from here

flow logic accounts case 1.gif

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

View solution in original post

9 REPLIES 9

jcmings
Mega Sage

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
        • Else if Look Up Records Count > 0
          • If record status = Success
            • Update record

 

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.

 

AnkurBawiskar_1-1742572542917.png

Ankur Bawiskar
Tera Patron
Tera Patron

@Snowman15 

Something like this will help you and you can enhance it further

AnkurBawiskar_0-1742570609459.gif

 

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Ankur Bawiskar
Tera Patron
Tera Patron

@Snowman15 

something like this, please enhance

AnkurBawiskar_1-1742572542917.png

 

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader