Where are the results of sn-record-picker saved?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
This will probably sound strange, but stay with me.
I have a widget that uses <sn-record-picker> in one of its fields to get values from a table in the db based on a query.
I can see in my browser's developer tools > Network the query being made when clicking into the field.
I want to know where the results are going before showing on the page and how I can access that.
My goal is to hardcode a value on the top of the list of results for the user to select.
Unfortunately there does not seem to be any documentation on it, so this is my last resort.
Thanks for your help
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
I believe it's stored in Angular JS model object.
I don't think the OOTB <sn-record-picker> allows you to inject custom options directly.
Why not use dynamic filter or default-query for this?
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
14 hours ago
Thank you for your response Ankur, unfortunately it seems that the model object is nowhere to be found, even when explicitly trying to access it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
14 hours ago
yeah, I already informed it must be tracked internally and hence you cannot know that.
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader