The Zurich release has arrived! Interested in new features and functionalities? Click here for more

Where are the results of sn-record-picker saved?

DanaiM
Tera Contributor

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

3 REPLIES 3

Ankur Bawiskar
Tera Patron
Tera Patron

@DanaiM 

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.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

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. 

@DanaiM 

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.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader