The Zurich release has arrived! Interested in new features and functionalities? Click here for more

Flow designer look up action based on date does not return the expected result

mfhaciahmetoglu
Mega Sage

Hey all,

 

I need to look up on hardware assets records where

- Asset function == primary

- Warranty Expiration == today + 2 months (this is a custom field of Date type).

 

I set up the flow on Flow Designer:

1. Set the flow variable to 2 months from now:

mfhaciahmetoglu_0-1741708900094.png

2. Look up records:

mfhaciahmetoglu_1-1741708923890.png

All looks fine.

I have a record that meets the conditions: 

mfhaciahmetoglu_2-1741708975748.png

I run a test. The variable is set correctly:

mfhaciahmetoglu_3-1741709018946.png

The lookup is run okay:

mfhaciahmetoglu_4-1741709036790.png

 

However, as you can see, the record is not returned.

 

When I set the filter before or after, it does not work either.

 

Any one has any idea why?

 

I tried to write a script to see what happens.

 

var gdt = new GlideDate();
gdt.addMonthsLocalTime(2);

var gd = new GlideRecord('alm_hardware');
gd.addEncodedQuery('asset_function=primary^u_glide_date_1ONgdt;');
gd.query();
while (gd.next()) {
  gs.addInfoMessage(gd.getValue('asset_tag'));
}

 

This script returns all records.

 

So, something seems to be wrong but I don't know why.

 

Any ideas?

 

Thanks.

 

Best,

Firat

 

 

6 REPLIES 6

Dr Atul G- LNG
Tera Patron
Tera Patron

Hi @mfhaciahmetoglu 

I'm not an expert, but based on what I've learned, let's try to break this condition into two parts. First, try to get Asset function == primary and check if the records are coming or not. If yes, then add another condition. This will help us determine whether the issue is with the condition itself or something else.

*************************************************************************************************************
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.

Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]

****************************************************************************************************************

Hi, thanks!

 

Asset function works, it is the date that does not work. 

 

It seems that adding a custom flow variable as a condition to compare does not work in any case (I tried before after as well). Weird.

 

Best,

Firat

Hi @mfhaciahmetoglu 

 

Might be helpful

 

https://www.servicenow.com/community/developer-forum/reminder-email-every-3-days-after-due-date-on-t...

 

https://www.servicenow.com/community/now-platform-forum/how-to-send-a-notification-in-the-flow-desig...

*************************************************************************************************************
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.

Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]

****************************************************************************************************************

Ankur Bawiskar
Tera Patron
Tera Patron

@mfhaciahmetoglu 

try to give the filter as this

Warranty Expitation = Flow Variable

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