Apply filter to WSD Location Integration with Picker widget - 'Location'

Julie Gordon
Mega Sage

Within the WSD Location Integration with Picker widget, the 'Location' option displays all Active buildings. 

location.jpg

 I need a filter to only show Active buildings on 1 Campus. 

 

I think I've found the part of the widget where it's being filtered, but when I make any changes, it shows No Results.

code.jpg

 

I've tried multiple ways but nothing works.  Any help is appreciated. 

1 ACCEPTED SOLUTION

Sarthak-  Again thank you for your time & suggestions. 

I was able to get my desired result using 'active=true^parent=7f986d051bc079504e8adca1b24bcbc3' .  For some reason it likes the Parent field, but not the Campus field & it wanted the sys_id of the parent. 

View solution in original post

7 REPLIES 7

Sarthak Kashyap
Kilo Sage

Hi @Julie Gordon ,

 

I tried your problem in my PDI and it is working fine for me please check below html code 

<sn-record-picker 
    field="user" 
    table="'sys_user'" 
    display-field="'name'" 
    value-field="'sys_id'" 
    search-fields="'name'" 
    page-size="100" 
    default-query="'user_name=sarthak.kashyap'">
</sn-record-picker>

I gave table name as sys_user and default query as user name is mine so it is giving just my name, you can change it to cmn_location and in default-query you can give active is true

 

SarthakKashyap_0-1762450413556.png

 

Please mark my answer correct and helpful if this works for you

Thanks and Regards,

Sarthak

Sarthak- Thank you so much for this quick response. 

 

I follow what you are saying & you are correct, if I change the filter to name=<insert name> it filters for the name.  Then even if I throw in an ^OR, it still filters as expected.  But it still won't work when I try to filter on 2 fields 'active=true^campus=Home Office'

 

I feel like I'm not getting the syntax correct.  Or maybe because Campus is a reference field?

Hi @Julie Gordon ,

 

I tried your problem with 2 filter condition it is working fine please check below code 

<sn-record-picker 
    field="number" 
    table="'incident'" 
    display-field="'incident'" 
    value-field="'number'" 
    search-fields="'number'" 
    page-size="100" 
    default-query="'active=true^state=1'">
</sn-record-picker>

 

Or you can also share me your code I'll check 

 

Please mark my answer correct and helpful if this works for you

Thanks and Regards,

Sarthak

I've got to think it's something in my environment because this is all I'm trying to do

JulieGordon_0-1762459024799.png