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

how to set condition into export definition

Deepa12
Tera Contributor

Hi,

Please advise how to set condition into export definition -  Opened on or after 25 months ago
Incident Resolved At on or after 25 months ago
Problem Resolved At on or after 25 months ago
Deepa12_0-1788166607076.png thanks.

 

1 ACCEPTED SOLUTION

Mark Manders
Tera Patron

What did you already try and where are you stuck? It's a simple condition:
Ashampoo_Snap_maandag 31 augustus 2026_11h18m1s.png


Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark

View solution in original post

2 REPLIES 2

Mark Manders
Tera Patron

What did you already try and where are you stuck? It's a simple condition:
Ashampoo_Snap_maandag 31 augustus 2026_11h18m1s.png


Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark

IbrarA
Tera Guru

Hi @Deepa12 ,

No scripting needed. On the Export Definition's Condition field, you can pick your date field, set the operator to relative, then on or after, 25, Months, ago, and repeat the same for the other two fields. Rather than writing the encoded query by hand, try building it once on the source list, then right click the applied filter above the list and choose Copy query. That gives you the exact string, which matters here because the tokens the platform writes out don't always match the labels you picked in the builder. Your field labels also look like a database view, so the column names will carry the view prefix. One catch: if you AND all three conditions, any row with an empty Problem Resolved At drops out. You can put ^OR between them, or keep the AND and add ^OR<resolved_field>ISEMPTY for each. If you want the cutoff pinned to the start of a calendar month rather than shifting with the run time, you can try opened_at>=javascript&colon;gs.monthsAgoStart(25) instead.

 

 

Thanks.

 

ibrar