Widget - pass data to another widget to be used in server script

SC17
Tera Contributor

Hi.

I have 2 widgets. One has a GlideRecord script. I want to pass the result of this script to be used in another GlideRecord script in a different widget. I dont want to broadcast or emit the result to be used in HTML, I need to use the result in the server side.

Any ideas?

 

Thank you.

14 REPLIES 14

@ChrisBurksI'm sure that is what is being done however $location applies globally to the page/application and should mean the exact same thing for all widgets/the whole page. So if the location contains a parameter sys_id, it should be the same parameter for everything on the page. Not the sys_id of something for some widgets and the sys_id of some other things for other widgets.

Also important to mention that all widgets are written with the understanding that those parameters are global and mean the same thing for every widget.

@-O-Right, but what you state there has nothing to do with what $location can do. I was specifically talking about the response on $location.


@-O- wrote:

$location are in no way meant to do what you are trying to do.


 

I agree with you that you can't just arbitrarily use parameters on a url, especially if another widget on the same page uses the same parameter for a different reason. This is why if you read my posts that I'm asking him to give more information about her/his setup. Otherwise she/he has the full picture of what is there and I leave them with the responsibility of knowing that.

 

If they have full control of the two widgets in question "sys_id" doesn't have to be used. In fact I never mentioned sys_id in my previous posts. I'm simply answering her/his basic question of, "Any ideas?" referring to passing data to another widget without the use of broadcast or emit.

And using url parameters is one way, no doubt on that. I have also offered embedding widgets which data can be passed via options or inputs; (server side, client side respectively).

And another idea is using a Angular Provider as a Service but that depends on how it's implemented.

 

@ChrisBurksI don't dispute any of that.

Though the complete picture has been provided: what is needed is to display the variables of a parent record (sn_hr_core_case) when the child record (sn_hr_core_task) is viewed in portal, in the form widget.

That is why I mentioned sys_id - thought you've read those details.

The Variable Summarizer widget uses sys_id and table on the URL, to locate the record that contains the variables.

Obviously because of this, when the sn_hr_core_task is opened, no variables will be found - the variables belong to another record: the parent record.

SC17
Tera Contributor

Hi guys.

 

I would like to appreciate everyones replies and input, @ChrisBurks and @-O-  you guys gave me a great insight.

 

In the end I had to copy the code from the Variable Summarizer to the main Widget because in the main widget I have the HR Task data, so I did a gliderecord and accessed the parent HR Case. The display is a little bit different then using a tab, it is showing like this:

 

SC17_0-1674390657543.pngSC17_1-1674390713734.png

 

 

ChrisBurks
Mega Sage

@SC17- I'm glad you were able to work it out.