In Service Portal, "sn-record-picker" directive is not displaying reference field.

Chandan Kumar7
Mega Contributor

Hi Community,

I am trying to use a reference type field as display-field property for sn-record-picker. However, i don't get any value displayed when i am using reference type variable. When i try with other type of the field, i am able to display the field value.

Please help me here in displaying the reference field for sn-record-picker.

7 REPLIES 7

Harish KM
Kilo Patron
Kilo Patron

exmple here

https://community.servicenow.com/community?id=community_question&sys_id=15aa872ddb5cdbc01dcaf3231f96197a&view_source=searchResult

Regards
Harish

Thanks for the reply, I did go through the details in the link.However, i didn't find any concrete solution or workwround for the issue.

Oleg
Mega Sage

Could you post the code, which you use and details about the table/field, which you want to display.

when I try with a non-reference field (u_case_status) in dispalay-field parameter , i get the records.


<sn-record-picker id="resolutionCheckBox" field="c.resoutionItem" placeholder="All" table="'u_aps_case_close_reason_mapping'" display-field="' u_case_status'"

                                              value-field="'sys_id'" search-fields="'label'" page-size="100"

                                              on-change="c.getResolutionValue()"

                                              default-query="'u_case_type='+data.curCaseType+'^u_business_line='+data.curBL+'^u_case_status='+data.curStatus">

                            </sn-record-picker>

 

 

when I try with a reference field (u_case_close_reason) in display-field parameter , i get no records or only invisible records.

 

<div>
<sn-record-picker id="resolutionCheckBox" field="c.resoutionItem" placeholder="All" table="'u_aps_case_close_reason_mapping'" display-field="'u_case_close_reason'"

                                              value-field="'sys_id'" search-fields="'label'" page-size="100"

                                              on-change="c.getResolutionValue()"

                                              default-query="'u_case_type='+data.curCaseType+'^u_business_line='+data.curBL+'^u_case_status='+data.curStatus">

                            </sn-record-picker></div>

 

The issue is that i am not able to display a reference field for sn-record-picker.