3 Replies Latest reply on Jan 15, 2018 2:01 PM by mbasha RSS
    mbasha Apprentice

    Displaying the current data from mysql database into the properties

    I have one requirement, that my device is directly sending the data and it has been storing in MySQL database. Now I want to display the recent data in the properties of a thing so that I can create Mashup screen.

     

    As per mu knowledge, I can retrieve the data from database into the thingworx. After that how can I show them i the properties?

      • Re: Displaying the current data from mysql database into the properties
        supandey Ninja

        Hi Mahaboob, if you are mapping each device with it's respective Thing in the ThingWorx, you assume that Thing will have it's own properties. With that assumption you can simply create your SQL service under that Thing and assign the output of that service to the property of that Thing. Or otherwise you can also simply call that service directly onto the Mashup and display the data in a Grid or a Chart as per your requirement.

          • Re: Displaying the current data from mysql database into the properties
            mbasha Apprentice

            Thanks for your Quick Reply,

            am giving in brief about my requirement,

             

            Requirement


            1. 1) Min and Max and actual value it has to fetch every row from database at certain interval (For example at first it has to fetch 33,45,55 from database and has to show in gauge widget, After 30 seconds If the min and max value is empty then use the same previous value only fetch the value 47 and show the updated, After 30 seconds if the min and max value in 3rd row is different then fetch 44,65,85 and show in the widget.

              • Re: Displaying the current data from mysql database into the properties
                supandey Ninja

                I think this should be achievable by

                 

                1. Writing SQL statement which will return all the required values, i.e. in this case Min, max and actual value; may be wrap that with a JS service to apply those additional logic of checking the values

                 

                2. You can now choose to put those values in an InfoTable or you could assign them individual properties of a Thing

                 

                3. Depending where you are storing those values in ThingWorx i.e. Infotable or Thing's properties you can simply use the OOTB service calls to get the property values and assign them individually to Gauge Widget.

                 

                4. Now to automate the part that the service executes every n number of secs you can use an Auto refresh widget calling that service periodically within the mashup.