- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-25-2017 11:07 AM
Is it possible to have a field's choice list dynamically populated from an API call?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-25-2017 11:45 AM
Yes, You can do this using Ajax calls.
You can write an onLoad client script, that calls an Async Glide Ajax which retrieves the requires choices from your API. For eg if REST API, then you require the Rest Message to get values from an external system. The values can be returned and updated on the choice field using g_form.addOption();
Thank You
Please Hit Like, Helpful or Correct depending on the impact of response
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-25-2017 11:45 AM
Yes, You can do this using Ajax calls.
You can write an onLoad client script, that calls an Async Glide Ajax which retrieves the requires choices from your API. For eg if REST API, then you require the Rest Message to get values from an external system. The values can be returned and updated on the choice field using g_form.addOption();
Thank You
Please Hit Like, Helpful or Correct depending on the impact of response
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-25-2017 02:27 PM
That did it.
Thanks Alikutty.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-26-2017 05:17 AM
Hi Courtney,
If I have answered your question, can you please mark my response as correct so that others with the same question in the future can find it quickly and that it gets removed from the Unanswered list.
If you are viewing this from the community inbox you will not see the correct answer button. If so, please review https://community.servicenow.com/docs/DOC-5601
Thank You
Please Hit Like, Helpful or Correct depending on the impact of response
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-26-2021 01:59 AM
Hi Courtney,
I know its an old post.I have similar type of requirement.Can I have teh script here.
Thanks in advance.
Regards,
Afifa