Can a Widget on a Record Producer update the g_form?

Luc_Sutherland
Tera Expert

I have a record producer I want to use in the Service Portal.

On my record producer, I have a Single Line Text type field called string_field.

I also have a Custom type field with an embedded widget.

This widget has a button. I want to press this button and have the string_field value be updated to "Hello World."

Is this possible?

1 ACCEPTED SOLUTION

Ankur Bawiskar
Tera Patron

@Luc_Sutherland 

check this link

https://www.servicenow.com/community/developer-forum/service-portal-widget-grabbing-variable-value-o... 

when your button is clicked trigger a function and set the variable as this

    $scope.page.g_form.setValue('variable_name', 'Hello World.');

If my response helped please mark it correct and close the thread so that it benefits future readers.

View solution in original post

2 REPLIES 2

Ankur Bawiskar
Tera Patron

@Luc_Sutherland 

check this link

https://www.servicenow.com/community/developer-forum/service-portal-widget-grabbing-variable-value-o... 

when your button is clicked trigger a function and set the variable as this

    $scope.page.g_form.setValue('variable_name', 'Hello World.');

If my response helped please mark it correct and close the thread so that it benefits future readers.

@Luc_Sutherland 

Hope you are doing good.

Did my reply answer your question?

If my response helped please mark it correct and close the thread so that it benefits future readers.