How to populate the field details from a popup to the Record producer form in Service Portal

RevathiV
Giga Expert

On the Record Producer I have custom widget variable which opens a popup. 

RevaVemp_0-1681276033480.png    RevaVemp_1-1681276049156.png

 

On click of Submit button, I want to copy the field details from the popup to the Record Producer form Department field.

RevaVemp_2-1681276100366.png

 

I don't want to make any changes to the OOB 'SC Catalog Item' widget.

 

Could you please advice.

Many Thanks.

 

4 REPLIES 4

Ankur Bawiskar
Tera Patron
Tera Patron

@RevathiV 

why to use widget?

why not use a OOB variable which is of type reference?

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

I have a requirement to implement something like this. I just posted this as an example. 
The field in the pop-up could be a dropdown with options or a text field. 

On Submit , I need to copy the values from the popup to it's corresponding field on the record Producer form (in Service Portal)

@RevathiV 

but can't you re-use any existing variable type if you already know what user will be populating like reference, choice, checkbox etc

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Debendu
Tera Contributor

Hi @RevathiV ,

You can use $scope.page.g_form in the widget client script to set the catalog variable value from the custom widget.

Use the below code in the Submit button's ng-click function.

$scope.page.g_form.setValue('field name', <input field value>);