Custom Widget: send data from server script back to client script in order to populate form field on page in service portal

ServiceLater1
Giga Contributor

I have a custom widget that is displayed as a modal pop-up on a page in our service portal.

I am trying to find a way, to populate a field on the service portal page from within the client-script of the widget. Is this possible and how?

See attached image for what I have so far.

The error in the browser console that I am receiving is that g_form is not a function:

"TypeError: g_form.setValue is not a function"

1 ACCEPTED SOLUTION

Sunjyot Singh
Kilo Guru

Hi,

You can bind the data to the field using ng-model. No need to to set value in the client script :

find_real_file.png

Does this solve the purpose?

 

Thanks.

View solution in original post

3 REPLIES 3

Sunjyot Singh
Kilo Guru

Hi,

You can bind the data to the field using ng-model. No need to to set value in the client script :

find_real_file.png

Does this solve the purpose?

 

Thanks.

Thank you but I don't want to populate a field in the HTML of the widget. I want to populate a field on the service portal page on which this widget is being displayed. Hope I am explaining it right.

ServiceLater1
Giga Contributor

Hoping someone can help me here.

Just to clarify, I want to take the server-script response of the widget and use it to populate a form field that is on the PAGE in the service portal on/in which this widget is loaded after they fill out the fields in the widget and click submit.

So desired workflow is:

  1. User is on a specific page in our service portal and clicks a button which pops up a spmodal with a widget in it.
  2. User fills out the fields in the widget and presses on submit.
  3. Now a form field on the current page is filled out based on the server-script response of the widget.