Adding a default value in sn-record picker
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-07-2023 10:02 AM
I have an sn record picker in which i am referencing the "core_country" table. I want to populate a default value whenever i open the widget. The default value of the country should be "India".
Could someone please help me in this.
Thank you
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-07-2023 10:12 AM - edited 07-07-2023 10:13 AM
Hi @Apurv Kumar,
Take a look at old thread. It will help you to set the default value for sn-record picker.
How can I Set Value to snRecordPicker if the rowCount is 1
How do I set a default value for snRecordPicker directive?
Reference Fields with the snRecordPicker Directive
Thanks,
Sagar Pagar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-07-2023 11:13 AM
Hi @Apurv Kumar ,
Hope you are doing great.
- Locate the SN record picker widget in your ServiceNow instance.
- Access the widget configuration settings.
- Find the property that allows you to specify a default value for the record picker.
- Set the default value property to "India" or the corresponding value that represents India in the "core_country" table. Ensure that the default value matches the appropriate field in the "core_country" table (e.g., the sys_id or another unique identifier for India).
- Save the widget configuration settings.
Regards,
Riya Verma
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-07-2023 11:18 AM
@Riya Verma wrote:Hi @Apurv Kumar ,
Hope you are doing great.
- Locate the SN record picker widget in your ServiceNow instance.
- Access the widget configuration settings.
- Find the property that allows you to specify a default value for the record picker.
- Set the default value property to "India" or the how to drag click without tape corresponding value that represents India in the "core_country" table. Ensure that the default value matches the appropriate field in the "core_country" table (e.g., the sys_id or another unique identifier for India).
- Save the widget configuration settings.
In ServiceNow, the sn-record-picker is a UI component used for selecting records from a specific table. To add a default value to the sn-record-picker component, you can follow these steps:
Locate the sn-record-picker Widget: In your ServiceNow instance, find the location where the sn-record-picker widget is being used. This could be within a form or a custom UI page.
Open the Form Designer: Open the Form Designer for the respective form or UI page where the sn-record-picker widget is placed. This allows you to modify the properties of the widget.
Edit the sn-record-picker Widget Properties: Within the Form Designer, locate the sn-record-picker widget, and access its properties.
Find the Default Value Property: Look for a property or attribute named "default value" or something similar. This property allows you to set the default value for the sn-record-picker.
Set the Default Value: Enter the desired default value in the property field. The value should be a sys_id or a unique identifier of the record you want to set as the default value.
Save and Publish: Save your changes in the Form Designer and publish the form or UI page.
By following these steps, you should be able to set a default value for the sn-record-picker component in ServiceNow. The specified default value will be pre-selected in the picker when the form or UI page is loaded.