• Recent
    • Tags
    • Popular
    • Register
    • Login

    Please Note This forum exists for community support for the Mango product family and the Radix IoT Platform. Although Radix IoT employees participate in this forum from time to time, there is no guarantee of a response to anything posted here, nor can Radix IoT, LLC guarantee the accuracy of any information expressed or conveyed. Specific project questions from customers with active support contracts are asked to send requests to support@radixiot.com.

    Radix IoT Website Mango 3 Documentation Website Mango 4 Documentation Website Mango 5 Documentation Website

    How we can filter the json and dynamically pass the data to create multiline chart in mango automation

    Mango General
    3
    21
    7.0k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • MattFoxM
      MattFox @himanshu
      last edited by MattFox

      @himanshu said in How we can filter the json and dynamically pass the data to create multiline chart in mango automation:

      toilet=TSTE-H2&dp=Temperature&dp=State&type=shioiaq2

      I suggest you change dp to dp1 and dp2. By using dp twice you overwrite the parameter.

      Secondly, have you read this help doc?

      https://docs-v3.mango-os.com/dynamic-floor-plan

      Only out with my phone at the moment so I dont have an active mango instance handy! Only whats in my head...
      That doc explains how to attach params to components in the dashboard.

      Fox

      Do not follow where the path may lead; go instead where there is no path.
      And leave a trail - Muriel Strode

      H 1 Reply Last reply Reply Quote 0
      • H
        himanshu @MattFox
        last edited by

        @mattfox
        Thanks Mate..
        But the url is coming from different page.
        Like <a ng-href="www.testurl.com/ui/testpage/?toilet=TSTE-H2&dp=Temperature&dp=State&type=shioiaq2"

        and now on testpage.html
        i am using <ma-state-params> where i want data to get placed on basis of URL.

        1 Reply Last reply Reply Quote 0
        • MattFoxM
          MattFox
          last edited by MattFox

          As I said, read the help docs, create a watchlist with query as the type and add your parameters in there. Leverage them with the stateparams and apply them to the watchlist lookup

          https://docs-v3.mango-os.com/linking-to-dynamic-pages

          Fox

          Do not follow where the path may lead; go instead where there is no path.
          And leave a trail - Muriel Strode

          H 1 Reply Last reply Reply Quote 0
          • H
            himanshu @MattFox
            last edited by

            @mattfox
            Hey Mate,
            as per you above example I am doing the same thing but my problem is...
            I want to access those params in one of my controller/component file.

            <a ng-href="www.testurl.com/ui/testpage/?toilet=TSTE-H2&dp=Temperature&dp=State&type=shioiaq2">

            This link would redirect me to my component called testpage.html in that file i am unable to access the params .
            I want to access my params in my components HTML file as well as controller file.

            CraigWebC 1 Reply Last reply Reply Quote 0
            • MattFoxM
              MattFox
              last edited by

              What's your controller?
              Paste all code here. May as well look at what you are doing.
              Are you extending with the userModule?

              Do not follow where the path may lead; go instead where there is no path.
              And leave a trail - Muriel Strode

              H 1 Reply Last reply Reply Quote 0
              • H
                himanshu @MattFox
                last edited by himanshu

                @mattfox
                Yes we are extending the userModule.
                I just want to "get" the param in html / controller file .

                1 Reply Last reply Reply Quote 0
                • MattFoxM
                  MattFox
                  last edited by

                  Sorry am a little overrun, however, this is their dashboard repo.
                  https://github.com/infiniteautomation/ma-dashboards/tree/3.7.x

                  This should shed some light on how their stateparams work

                  Fox

                  Do not follow where the path may lead; go instead where there is no path.
                  And leave a trail - Muriel Strode

                  1 Reply Last reply Reply Quote 0
                  • MattFoxM
                    MattFox
                    last edited by MattFox

                    Just had a thought, thinking about something I did recently... I didnt care much for params since I had my own components doing the heavy lifting.. So I used the $state provider and pulled in the url, split by / then use what was on the end. Why dont you do the same with the ? and the &? Then split each result by = for your key value pairs and run as needed. Just one of those shower thoughts haha.

                    EDIT: Nope sorry, completely ballsed that one up. If you want your params, add to the menu item: ?item1&item2
                    Do not add = in your menu link. Just do that and your stateparams will be available.
                    ie: your menu link will be.

                    /mycomponentpage?thisDevice&thatvalue&anotherkey
                    

                    Your $state.params will be

                    {
                    thisDevice: '',
                    thatvalue:'',
                    anotherkey:''
                    }
                    
                    

                    Fox

                    Do not follow where the path may lead; go instead where there is no path.
                    And leave a trail - Muriel Strode

                    1 Reply Last reply Reply Quote 0
                    • CraigWebC
                      CraigWeb @himanshu
                      last edited by

                      @himanshu Does this help page answer your question ? https://docs-v3.mango-os.com/linking-to-dynamic-pages

                      H 1 Reply Last reply Reply Quote 0
                      • H
                        himanshu @CraigWeb
                        last edited by

                        @craigweb
                        No this in not useful in my scenario as I have urn passing to one of my component and I want to use those URL parameters in component.

                        This example only works when we created two pages from dashboard designer and then linking to each another.
                        But not working with page to component parsing.

                        CraigWebC 1 Reply Last reply Reply Quote 0
                        • MattFoxM
                          MattFox
                          last edited by

                          Refer to your other post, I left an update there should that help you

                          Fox

                          Do not follow where the path may lead; go instead where there is no path.
                          And leave a trail - Muriel Strode

                          1 Reply Last reply Reply Quote 0
                          • CraigWebC
                            CraigWeb @himanshu
                            last edited by

                            @himanshu

                            It is the exact same concept.:
                            <ma-state-params on-change="designer.parameters.dn = $stateParams.dn" update-params="designer.updateParams"></ma-state-params>
                            this component takes the URL parameters and puts them into a object called designer.updateParams. That object can be used anywhere now in the pages scope.

                            1 Reply Last reply Reply Quote 0
                            • First post
                              Last post