cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Learn all about PTC Community Badges. Engage with PTC and see how many you can earn! X

How to get Mashup parameters dynamically via service or expression or widget?

Ashritha
15-Moonstone

How to get Mashup parameters dynamically via service or expression or widget?

Hi,

 

Requirement :

  • Need to get mashup parameters as string from url on runtime (for the dynamic implementation of breadcrumb on Master mashup)

ThingWorx doesn't support location.search() to get URL parameters.

Mashups[<mashupName>].GetParameters() provides only the definition of mashup parameter.

Is there any other way to get mashup parameter on runtime without binding each parameter separately in each and every mashup?

 

Or Is there a widget that allow window.location.search() functionality in ThingWorx (Ex: link )  . 

 

Thank you,

Ashritha

ACCEPTED SOLUTION

Accepted Solutions
GuillaumeL
13-Aquamarine
(To:Ashritha)

Hello,

 

If you know JavaScript method, you may try to create an extension that calls window.location.search() analyze parameters and return a result (InfoTable or String).

Per design in ThingWorx I am not sure that this is possible. The only way is to rework all mashups to have a parameter called dynamicParam and in this parameter you can put whatever you want like dynamicParam=param1;1|param2;abc. But I am sure that you will not like this proposition

 

Rgds,

Guillaume

View solution in original post

4 REPLIES 4

If you create a mashup parameter that is the same name as your URL parameter, TWx should automatically bind it to that mashup parameter.  

 

For instance, if you create a parameter in your mashup called "serialNumber" and then navigated to /myMashup?serialNumber=12345, it should work.

 

Hope that helps,

 

Nick

Ashritha
15-Moonstone
(To:nmilleson)

Hi  @nmilleson ,

Thanks for the response!!

 

Above method is to use mashup parameter as URL parameter .

But my use case is different.

 

Use Case:  Need to implement bread crumb for more than 500 mashups along with Menu . So created breadcrumb in the master mashup. Breadcrumb is working fine for the forward navigation. When traversing back or on click of breadcrumb , mashups are blank due to null mashup parameters.

Because of this reason either need to manually add a service/expression in every page to get mashup parameter in string format

(Ex: Output string as "?param1=1&param2=abc") or need to do dynamically at master level.

Mashup parameter's name and types are different in every page.

To avoid adding service in each page, need to know a method to get mashup parameter/ url parameter as string dynamically.

This feature exist in JavaScript as window.location.search() , But ThingWorx is not supporting the same.

Is there any way to do above mentioned use case dynamically?

 

Thank you,

Ashritha

 

 

 

 

 

You could probably use session parameters to psuedo-achieve this but you'll still have to do some sort of bindings on each page.  You can either modify the GlobalSessionProperties ThingShape and add any properties that you want to have access to across all of your mashups, or create your own ThingShape and add it to the configuration in UserManagementSubsystem.  I'm not aware of any way in ThingWorx to specifically accomplish what you're trying to do. 

 

Nick 

GuillaumeL
13-Aquamarine
(To:Ashritha)

Hello,

 

If you know JavaScript method, you may try to create an extension that calls window.location.search() analyze parameters and return a result (InfoTable or String).

Per design in ThingWorx I am not sure that this is possible. The only way is to rework all mashups to have a parameter called dynamicParam and in this parameter you can put whatever you want like dynamicParam=param1;1|param2;abc. But I am sure that you will not like this proposition

 

Rgds,

Guillaume

Announcements


Top Tags