Resttrict sn-record-picker to select value based on some condition

yadavsatya
Tera Contributor

Hi Folks,

I am using sn-record-picker in my web portal, i want to restrict picker to set value  based on some condition, or want to restrict to select the value, is it feasible to achieve this?

1 ACCEPTED SOLUTION

Deepak Ingale1
Mega Sage

Hello,

 

sn-record-picker directive provides default-query attribute. You can passon encoded query to it to limit the number of records shown in record picker

 

https://community.servicenow.com/community?id=community_question&sys_id=bd6887eddb1cdbc01dcaf3231f96...

https://community.servicenow.com/community?id=community_question&sys_id=91b08765db98dbc01dcaf3231f96...

https://community.servicenow.com/community?id=community_question&sys_id=d0738b25dbd8dbc01dcaf3231f96...

 

Note: Please mark reply as correct if it has answered your ORIGINAL question posted.

View solution in original post

3 REPLIES 3

Deepak Ingale1
Mega Sage

Hello,

 

sn-record-picker directive provides default-query attribute. You can passon encoded query to it to limit the number of records shown in record picker

 

https://community.servicenow.com/community?id=community_question&sys_id=bd6887eddb1cdbc01dcaf3231f96...

https://community.servicenow.com/community?id=community_question&sys_id=91b08765db98dbc01dcaf3231f96...

https://community.servicenow.com/community?id=community_question&sys_id=d0738b25dbd8dbc01dcaf3231f96...

 

Note: Please mark reply as correct if it has answered your ORIGINAL question posted.

shloke04
Kilo Patron

Hi,

 

As mentioned by Deepak, default-query attribute for SN Record Picker can be used as explained below like adding the Reference Qualifier at backend:

 

In the Server Side of the Widget:

 

data.object = 'Form your Encoded Query';

 

Then in SN Record Picker call the same as mentioned below:

 

<sn-record-picker

     field :

     table:

    default-query = 'c.data.object'>

</ sn-record-picker>

 

Hope this help. Please mark the answer as helpful/correct based on impact.

 

Regards,

Shloke

 

 

 

Hope this helps. Please mark the answer as correct/helpful based on impact.

Regards,
Shloke

yadavsatya
Tera Contributor

Hi,

Thanks for reply.