How to fetch value that is set/selected through sn-record-picker

siladityamishra
Kilo Contributor

Hi Guys,

I want to fetch the value that is set/selected through sn-record-picker

HTML:

<div ng-if="data.canRead" class="panel panel-primary b">  

  <div class="panel-heading">  

      <h4 class="panel-title pull-left">  

          ${Watch list}  

      </h4>  

      <div class="clearfix"></div>  

  </div>  

  <div class="panel-body">

          <div class="text-center text-italic text-muted">

            <sn-record-picker on-change="getWatchlists(watch_list)" field="watch_list" sn-disabled="!data.canWrite" table="'sys_user'" display-field="'name'" search-fields="'name'" value-field="'sys_id'" default-query="'active=true^web_service_access_only=false^user_nameISNOTEMPTY'" multiple="true"></sn-record-picker>

              <input type="button" value = "Apply"/>

             

      </div>

  </div>  

</div>  

Any help or idea will help me a lot

1 ACCEPTED SOLUTION

Rushit Patel2
Tera Guru

this blog will help



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



you can use field.change event in your client controller script and check if field changed is watch_list like this



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


if (parms.field.name == 'watch_list'){


your logic


}



})


});


View solution in original post

3 REPLIES 3

Rushit Patel2
Tera Guru

this blog will help



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



you can use field.change event in your client controller script and check if field changed is watch_list like this



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


if (parms.field.name == 'watch_list'){


your logic


}



})


});


Hi,



if this response solves the problem then can you please mark it answered so that we can close this and it can help someone in future.



Thanks


Hi Rushit,



Thanks for directing me in the right direction