Flow 'Look Up Record' sometimes doesn't use the correct condition (trigger)

MaximilianZ5054
Tera Contributor

Hi,

 

we currently have a problem, that a 'look up record' we use in a Flow only works sometimes. And I don't understand why.

 

We search in the sys_user table. And the condition is 'Sys ID' is "Trigger - Service Catalog > Requested Item Record > Requested for > Sys ID".

 

In the previous action (get Catalog Variables) we successfully get the requested_for user, so the User definitely exists. But in the next step it sometimes contains the Condition Sys ID="xxx" and sometimes its empty.

 

What really confuses me, is that it worked in most cases.

So whats the reason why the Trigger sometimes finds the Sys_ID and sometimes doesnt?

 

(I don't really need a solution, because I already found a alternative way. But it would still be helpful in general why it doesnt work.)

 

 

Best regards

Maximilian

2 ACCEPTED SOLUTIONS

Ankur Bawiskar
Tera Patron
Tera Patron

@MaximilianZ5054 

You should run flow as "System User"

May be it's running in user's session and that user doesn't have read access to the User Record.

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

surajit3
Tera Expert

 

This kind of issue with the “Look Up Record” action in Flow Designer is actually more common than it seems and usually relates to timing or data availability at runtime.

 

From your description, it sounds like the issue may be caused by the fact that the requested_for field isn’t fully populated at the moment the lookup action runs. Even though it appears correctly in the previous step (like when retrieving catalog variables), the Flow might be executing the “Look Up Record” before that data is reliably committed or accessible.

 

 

A few possible causes and tips:

 

 

  1. Race Condition or Execution Order: Even though Flow Designer looks linear, some actions may execute before the data is ready. Try inserting a small delay or a “Wait for Condition” step to ensure the data is available before lookup.
  2. Use Logging: Add a Log action just before the Look Up Record to log what value is being passed in the condition. It’ll help confirm if the Sys_ID is populated correctly at that step.
  3. Null Checks: Add a conditional check to ensure requested_for is not null or undefined before performing the lookup.
  4. Data Dependency on Trigger Source: If the Flow is triggered on a Requested Item, and you’re trying to access data from a higher-level record (like the catalog request or requested_for), make sure you’re referencing it correctly using dot-walking. Sometimes requested_item.request.requested_for behaves differently from requested_item.requested_for.

 

 

Even though you’ve found an alternative approach, it’s great to analyze these behaviors because they often hint at design-time assumptions not aligning with runtime behavior.

 

Hope this helps clarify things!

View solution in original post

3 REPLIES 3

Ankur Bawiskar
Tera Patron
Tera Patron

@MaximilianZ5054 

You should run flow as "System User"

May be it's running in user's session and that user doesn't have read access to the User Record.

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

@MaximilianZ5054 

Hope you are doing good.

Did my reply answer your question?

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

surajit3
Tera Expert

 

This kind of issue with the “Look Up Record” action in Flow Designer is actually more common than it seems and usually relates to timing or data availability at runtime.

 

From your description, it sounds like the issue may be caused by the fact that the requested_for field isn’t fully populated at the moment the lookup action runs. Even though it appears correctly in the previous step (like when retrieving catalog variables), the Flow might be executing the “Look Up Record” before that data is reliably committed or accessible.

 

 

A few possible causes and tips:

 

 

  1. Race Condition or Execution Order: Even though Flow Designer looks linear, some actions may execute before the data is ready. Try inserting a small delay or a “Wait for Condition” step to ensure the data is available before lookup.
  2. Use Logging: Add a Log action just before the Look Up Record to log what value is being passed in the condition. It’ll help confirm if the Sys_ID is populated correctly at that step.
  3. Null Checks: Add a conditional check to ensure requested_for is not null or undefined before performing the lookup.
  4. Data Dependency on Trigger Source: If the Flow is triggered on a Requested Item, and you’re trying to access data from a higher-level record (like the catalog request or requested_for), make sure you’re referencing it correctly using dot-walking. Sometimes requested_item.request.requested_for behaves differently from requested_item.requested_for.

 

 

Even though you’ve found an alternative approach, it’s great to analyze these behaviors because they often hint at design-time assumptions not aligning with runtime behavior.

 

Hope this helps clarify things!