field CONTAINS filter in API link

David Munoz
Giga Contributor

Good morning quarantined fellas,

I'm asking for your help to understand how to insert a Field Contains filter to an API link:

display_name (Contains) 'Alteryx' OR (contains) 'Tableau'


https://xxxxxxxxxx/api/now/table/alm_entitlement_user?sysparm_fields=sysparm_fields=display_name,active,assigned_to.user_name,assigned_to,active,department,allocated_to,allocated_to.asset.install_status

Thanks ahead for your time!

1 ACCEPTED SOLUTION

David Munoz
Giga Contributor

https://xxxxxxxxxx/api/now/table/alm_entitlement_user?sysparm_query=display_nameLIKEAlteryx^ORdisplay_nameLIKETableau&sysparm_fields=u_active,display_name,display_name.name,assigned_to.user_name,assigned_to,assigned_to.active,assigned_to.department,assigned_to.department.name,allocated_to,allocated_to.name=GRCRSSF-9DH9QW1,allocated_to.asset.ci.install_status

 

Heres the solution I found, thank you.

View solution in original post

6 REPLIES 6

Community Alums
Not applicable

Hola David,

I believe you need to add filter in the payload? IF so, this is how to do that (I am posting a working example) :

/api/now/table/incident?sysparm_query=sys_updated_on>javascript:gs.endOfLastWeek()^ORDERBYu_order&sysparm_fields=number,short_description,sys_id,u_order

Let me know if I am missing something here 🙂

 

Cheers,

Joro

P.S. Keep safe yourself and your loved ones from this virus! Good luck!

 

 

Thanks Joro, Im trying to understand your example, but still is not clear for me how to script the condition CONTAINS, can I pass it after the >javascript:gs as:

display_name>javascript:gs.display_name='Alteryx'

Is that what you mean?, thanks ahead!

Community Alums
Not applicable

Hi David,

yes you can. Use this pattern - after any next condition use ^ . For using 

sysparm_query=sys_updated_on>javascript:gs.endOfLastWeek()^ORDERBYu_order^assigned_toLIKEadmin&sysparm_fields=number,short_description,sys_id,u_order

use LIKE

Community Alums
Not applicable

F**k,

I forgot to add the "LIKE" in the query 😄 😄 :D.

Anyways  - glad its all good for you now 🙂

 

Cheers,

Joro