• 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 to pass a XID from an input container to a query

    How-To
    2
    3
    713
    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.
    • Z
      zenvakil
      last edited by

      Hey All,
      I'm having a bit of trouble getting a <ma-point-query> directive to work with a data source XID from a <md-input-container>.
      As you can see, when I manually enter the XID the code works as expected, but how do I automatically use the XID of the selected Data Source?

      <md-input-container>
              <label>Choose a data source</label>
              <ma-data-source-list ng-model="myDataSource"></ma-data-source-list>
          </md-input-container>
          {{myDataSource.name}}   {{myDataSource.xid}}   {{myDataSource.id}}
          <ma-point-query query="'eq(dataSourceXid,{{myDataSource}})&amp;sort(deviceName,name)&amp;limit(200)'" points="eventPoints"></ma-point-query>
      {{eventPoints.name}}
      

      60cabc7f-c732-4295-8f00-e2f74b836035-image.png

      <md-input-container>
             <label>Choose a data source</label>
             <ma-data-source-list ng-model="myDataSource"></ma-data-source-list>
         </md-input-container>
         {{myDataSource.name}}   {{myDataSource.xid}}   {{myDataSource.id}}
         <ma-point-query query="'eq(dataSourceXid,DS_f4bd539a-6d8d-4557-8248-1650c7a447e9)&amp;sort(deviceName,name)&amp;limit(200)'" points="eventPoints"></ma-point-query>
         {{eventPoints}}
      

      9af03bcc-3759-4780-a24e-808c098f6025-image.png

      1 Reply Last reply Reply Quote 0
      • Z
        zenvakil
        last edited by

        Sorry I sent the wrong snippet, its meant to say {{myDataSource.xid}} in the query not {{myDataSource}}

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

          @zenvakil said in How to pass a XID from an input container to a query:

          <ma-point-query query="'eq(dataSourceXid,DS_f4bd539a-6d8d-4557-8248-1650c7a447e9)&sort(deviceName,name)&limit(200)'" points="eventPoints"></ma-point-query>

              <ma-point-query query="'eq(dataSourceXid,'+myDataSource.xid+')&sort(deviceName,name)&limit(200)'" points="eventPoints"></ma-point-query>
          
             
          

          That's how I do it

          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
          • First post
            Last post