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.
How to pass a XID from an input container to a query
-
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}})&sort(deviceName,name)&limit(200)'" points="eventPoints"></ma-point-query> {{eventPoints.name}}
<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)&sort(deviceName,name)&limit(200)'" points="eventPoints"></ma-point-query> {{eventPoints}}
-
Sorry I sent the wrong snippet, its meant to say {{myDataSource.xid}} in the query not {{myDataSource}}
-
@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
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login