Can we add OR condition in addEncodedquery

Lina5
Tera Contributor

Hi,

I am new to servicenow, Can anyone please help me with below script?
Have to display link in email notification, based on 'home_country' / 'home_country_unlisted_person' selected in travel_table. Link will be picked from different table(country_location) from "country_info_website" filed
 
In travel_table
If Emp id is available in EID field, then Link should be displayed based on home_country field.
and if Emp id is Not available, then Link should be displayed based on home_country_unlisted_person field 
So, At a time only one is available (either home_country or home_country_unlisted_person)
 
 
How to add OR condition in addEncodedquery? or can we use if condition for this? if yes how?
 
1 ACCEPTED SOLUTION

Mark Roethof
Tera Patron
Tera Patron

Hi there,

This should help you creating encoded queries more easier:

- 2019-09-04 Utilizing the breadcrumb on lists to generate your query

If my answer helped you in any way, please then mark it as helpful.

Kind regards,
Mark
2020-2022 ServiceNow Community MVP
2020-2022 ServiceNow Developer MVP

---

LinkedIn
Community article, blog, video list

 

Kind regards,

 

Mark Roethof

Independent ServiceNow Consultant

10x ServiceNow MVP

---

 

~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

LinkedIn

View solution in original post

2 REPLIES 2

Yousaf
Giga Sage

Hi Payal,

Yes you can use "^NQ" for OR in addEncodedQuery

Check this link and let me know if it solves your problem

Encoded Query & Add Or Condition query

Join two Encoded queries by OR condition

Also you can copy your query easily from breadcrumbs refer to this to understand how to.

SIMPLIFY QUERIES WITH ENCODED QUERIES

 

Mark Correct or Helpful if it helps.


***Mark Correct or Helpful if it helps.***

Mark Roethof
Tera Patron
Tera Patron

Hi there,

This should help you creating encoded queries more easier:

- 2019-09-04 Utilizing the breadcrumb on lists to generate your query

If my answer helped you in any way, please then mark it as helpful.

Kind regards,
Mark
2020-2022 ServiceNow Community MVP
2020-2022 ServiceNow Developer MVP

---

LinkedIn
Community article, blog, video list

 

Kind regards,

 

Mark Roethof

Independent ServiceNow Consultant

10x ServiceNow MVP

---

 

~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

LinkedIn