Set Portal widget RP variables

BK22
Tera Contributor

Hi all,

I have a custom Service Portal widget form that we are using for tracking a user's selections based on a set of questions.

I'm attempting to pass a value from the Service Portal widget's Html form field, to an embedded widget which calls a Record Producer. My objective is to use the widgets input selections to set record producers variable selection. I've attempted to use the below Client Controller that doesn't work. Any help would be great. Thank you.

$scope.page.g_form.setValue('hidden_widget_value', 'test');

1 ACCEPTED SOLUTION

The $scope.page.g_form only works if g_form is brought into widget. If you didn't make any modifications to the SC Catalog Item widget then the way to use $scope.page.g_form is embedding the widget through a variable within the RP.

find_real_file.png

View solution in original post

9 REPLIES 9

BK22
Tera Contributor

Its a custom widget that I use as a wizard-style navigation to the record producer based on a set of questions. So, the question(input fields) will determine the record producers selections. Just attempting the old wizard process layout. Below is how the form is laid out. These selections will determine the RP variables. I just need to pass them. I will look into the options. Thank you for all your help!

 

find_real_file.png

You set seems like it's going to be a bit tricky. This still doesn't give me a full picture of your setup.

However, I think a possibility would be to create a Service provider and pass the selections made to that service.

From there use a widget as a hidden variable on any RPs that will be used in your set up that will then collect the data from that Service. From within the hidden variable you could then use $scope.page.g_form to place the data collected from the Service and set the variables values on the RP.

Or use $emit to broadcast the selected options and a $on to listen for the selections made within the hidden variable widget.

BK22
Tera Contributor

Its not custom, its just a clone of the "SC Catalog Item" that I use to set the RP that I want. Those radio buttons just hide/show the widget tag based on a client controller script.

So, I have the $root radio values passed to the embedded widget, I just want to have it accessible to the RPs variables. Once I can reference them in the RP I was hoping to use a catalog client script to do whatever needed with my RP variables. The $scope.page.g_form isn't working based on this. I believe it has to do with the lack of Service provider that you mentioned. 

The $scope.page.g_form only works if g_form is brought into widget. If you didn't make any modifications to the SC Catalog Item widget then the way to use $scope.page.g_form is embedding the widget through a variable within the RP.

find_real_file.png

BK22
Tera Contributor

Wow, this was my missing change. Thank you!