Community Tip - New to the community? Learn how to post a question and get help from PTC and industry experts! X
Hi,
Requirement :
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
Solved! Go to Solution.
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
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
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¶m2=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
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