sn-record-picker not showing drop down

techies
Kilo Expert

Hi All,

I have a record picker in a widget to be used in a portal. I have put the record picker in the html div tags as follows:

            <sn-record-picker field="location" table="'cmn_location'" display-field="'name'" value-field="'sys_id'" search-fields="'name'" page-size="100" ></sn-record-picker>

and withing the client side java I have put,

function($scope, $response) {

  /* widget controller */

  var c = this;

     

      $scope.location = {

      displayValue: c.data.loc.name,

      value: c.data.loc.sys_id,

      name: 'location'

};

$scope.$on("field.change", function(evt, parms) {

      if (parms.field.name == 'location')

              c.data.setLocation = parms.newValue;

      c.server.update().then(function(response) {

              spUtil.update($scope);

      })

});

     

}

However the record picker does not show a drop down box of the table.

Thanks, any help would be appreciated,

4 REPLIES 4

nathanfirth
Tera Guru

Are you getting any errors in the console?



I'm guessing you've already seen my tutorial:


https://serviceportal.io/sn-record-picker/



Did you try downloading the completed widget from Share?


https://share.servicenow.com/app.do#/detailV2/86b23f151370e2001d2abbf18144b0aa/overview


Hi,


No there are no errors. I believe the problem is with the record picker line itself as it is not showing a drop down box. I could not find a way to upload the xml file of your widget so I copied the code into another widget and it still didn't work.


Thanks.


Hi Roni,



I am facing the same issue. How did you correct it?



Regards


Swamy


When I press the pencil on the edit screen the drop down correctly displays however on the preview screen it is not there.