Interested in a ServiceNow event built for developers? Registration for now[dev]26 is officially open!

Lookup Record ,check status

armanoj
Mega Sage

Hi ,

 

lookup Record in flow 

When look up record action how to check there is any record satisfies condition. how to check that within the flow.

9 REPLIES 9

based on the condition 'status' I check but no fulling the condition.

as per my requirement

review task table I want to check 

for the corresponding parent record have any review task in request revision then update that review task state to assigned .  

Hello @armanoj ,

 

Have you check manually is there related record or not, for given condition .  If there is  record   then in status it will give you success otherwise error .

yashkamde
Giga Sage

Hello @armanoj ,

 

1) If you are using Look Up Record Action -> You get Record for that condition :

Screenshot 2026-09-24 190005.png

 

 

2) If you are using Look Up Records Action ->You get count + respective records as per count :

 

Screenshot 2026-09-24 190018.png

 

3) And If the condition not satisfy then you get the error :

Screenshot 2026-09-24 190123.png

 

If my response helped mark as helpful and accept the solution.

Tanushree Maiti
Tera Patron

Hi @armanoj 

 

Refer: https://www.youtube.com/watch?v=U898c4PMsWA&xstg=CAMSBhUD_LL2Hw%3D%3D

https://www.youtube.com/watch?v=hcdeqyaGKbk

 

Please Accept the solution if it assisted you with your question & Mark this response as Helpful.
Regards
Tanushree Maiti
ServiceNow Technical Architect
LinkedIn: https://www.linkedin.com/in/tanushreemaiti

Vishal Jaswal
Tera Sage

Hello @armanoj 

Seems like your requirement is - "Based on the parent record, I need to find any related Review Task that is currently in Request Revision status. If such a Review Task exists, update its state to Assigned."

var count = 0;
var reviewTask = new GlideRecord('your review task table name'); //update the table name
reviewTask.addQuery('parent', current.parent);
reviewTask.addQuery('state', 'request_revision'); //update the field name
reviewTask.query();
while (reviewTask.next()) {
    count++;
    reviewTask.setValue('state', 'assigned'); //update the field name
    //reviewTask.update();
}
gs.info(count);

 
If yes, then your flow will be something like:

VishalJaswal_0-1790268902610.png

 


 

VishalJaswal_1-1790268935902.png

VishalJaswal_2-1790268947358.pngVishalJaswal_3-1790268957444.png

VishalJaswal_4-1790268977495.png


Validation Results:

before:

VishalJaswal_5-1790268996529.png



after:

VishalJaswal_6-1790269005473.png

 


Hope that helps!