- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-22-2020 08:19 AM
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!
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-22-2020 10:46 AM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-22-2020 09:30 AM
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!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-22-2020 10:21 AM
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!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-22-2020 10:46 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-22-2020 01:27 PM
F**k,
I forgot to add the "LIKE" in the query 😄 😄 :D.
Anyways - glad its all good for you now 🙂
Cheers,
Joro