4 Replies Latest reply on Mar 10, 2017 9:21 AM by pchung RSS
    sdaram-2 Newbie

    Pass Parameters from Web page to Thingworx Mashup

    Hi Everyone My Requirement is bit different


    I want to Pass Parameters from Webpage to Thingworx Mashup.  To Explain In detail


    I have a webpage designed by ASP.NET here i am integrating Thingworx Mashup in Iframe control.


    So my Webpage have Asp.control and Thingworx mashup.


    In below screen i have integrated Thingworx mash up in iframe. rest all controls are asp.net controls


    When i select drop down (Asp.net Control ) the selected value of drop down should pass to thingworx mashup. and mashup should respond accordingly.


    The received values from Asp.net webpages i should use in Thingworx Mashup.


    I need to know the process how we can pass values from Asp.net web page thingworx Mashup.


    Looking for Positive Response.


    If any clarification in understanding requirement i will post in detail.







      • Re: Pass Parameters from Web page to Thingworx Mashup
        pchung Collaborator

        You can pass the parameters over the url.

        so let's say you have a mashup with a mashup parameter named param1

        you can set that by using <server>/Thingworx/Mashups/NameOfYourMashup&param1=value (note that sometimes you might be using ? for the first switch for example if you are using an appkey)

          • Re: Pass Parameters from Web page to Thingworx Mashup
            sdaram Newbie

            Hi Pai Chung,


            Thanks for your quick response.


            Can you please look into my actual requirement.  If i pass parameter to Thingworx Mashup from ASP.NET webpage.


            like in above screen if i pass drop down selected value ("BPC1 BAKED PC") to mashup pf thingworx like this


            For your Info

            for binding thingworx mashup asp.met i am using iframe


            <iframe id="if1" width="1000" height="400" style="visibility:visible" src="http://localhost:8080/Thingworx/Mashups/MWGraph? appKey=0f4b4662-7d09-46c3-a766-bbbcfa73ad99&x-thingworx-session=true">




            this is my Thingworx URL


            http://localhost:8080/Thingworx/Mashups/MWGraph? appKey=0f4b4662-7d09-46c3-a766-bbbcfa73ad99&x-thingworx-session=true


            "MWGraph"  --Mashup Name


            My questions are


            1) can i pass Selected Drop down value to URL like this?


            http://localhost:8080/Thingworx/Mashups/MWGraph? appKey=0f4b4662-7d09-46c3-a766-bbbcfa73ad99&x-thingworx-session=true&param1=BPC1 BAKED PC

            If param1 is my mashup parameter,

            2) How to define Mashup parameters in Thingworx mashup. Please refer me any pointers

            3)How can map this Query string value "param1=BPC1 BAKED PC" to mashup parameter.

            4)How can i utilize this Mashup parameter in Service to Load Pie Chart after binding with param1

            Please refer me any example that Explain Mashup Paramters, etc.

            Looking for Positive Response.

            Thanks & Regards


          • Re: Pass Parameters from Web page to Thingworx Mashup
            sdaram Newbie

            Hi Pai Chung,

            I have Done Following Steps for above my use case

            1) I have created Mashup parameter named it as "myparam"

            2) I have Created a Service in Thingworx Mashup "GetDataTableEntryByKey" and giving input as Mashup parameter (myparam)

            I bound my service by accepting input as Masup parameter(myparam) --->Key

            3) I am calling My Mash up in iframe like this

            <iframe id="if1" width="700" height="560" style="visibility:visible" src="http://localhost:8080/Thingworx/Mashups/testabc? appKey=0f4b4662-7d09-46c3-a766-bbbcfa73ad99&x-thingworx-session=true&myparam=1">



            http://localhost:8080/Thingworx/Mashups/testabc? appKey=0f4b4662-7d09-46c3-a766-bbbcfa73ad99&x-thingworx-session=true&myparam=1

            In the above URL.

            testabc--Mashup Name

            myparam--Mashup Parameter (value is '1')

            The web page looks like this

            So  Here I need Some Clarification and Help.

            in above Mashup myparm (mashup parameter) there is no input binding. The Output of myparm is input of service.


            1) How to assign value which i am passing in URL to mashup parameter.

            2) Is there any other way to use "Session parameter" to get this approach.


            looking for positive response.

            Thanks & Regards


              • Re: Pass Parameters from Web page to Thingworx Mashup
                pchung Collaborator

                &myparam=1 is how the value is assigned to the parameter. you can try binding the myparam from the mashup to a Value display on the mashup to check.

                then The service itself should run based on myparamvaluechanged event which comes with the mashup parameter

                I don't see a need to write to the session, if you needed to do that though you would wire from the mashup param to the session or use a service to set it server side.