We are making a call to an Nhaystack service which is running on Niagara 4.8 workbench. We have sites, equipment(AHU) created on a Demo station
API Call: https://tridium.dev.iot.synchronoss.net/haystack/read?filter=equipRef
Following is JSON Payload from the response: I have 2 questions:
How can I exclude/filter out the cols field from the API response
I have a column name "name": "dischargeAirFanCmd". I need to have a value assigned to this column "dischargeAirFanCmd" as the value of the column "curVal".
For your first question I have reviewed the REST API specifications as documented on this website and I couldn't see any reference to the server response being able to exclude specific columns. Therefore this will not be supported in nhaystack. If you wish to do this you would need to do some processing of the response grid in your client before presenting the grid to the user or the next step of your process.
For your second question I'm not sure how to achieve what you want. When using the control points in a Niagara station the value of the out slot is automatically applied to the curVal tag via implicit tagging. In nhaystack there isn't a configurable option to change where the value of the out slot is set.
Again, you could achieve this with some processing of the response on your client.
Justin ScottMon 16 Dec 2019
For the exclusion here is a Javascript example of how I process the payload responses:
Most languages should allow you to point to a path on the DICT/Object/etc. JS you get a good bit of flexibility as it treats JSON like a JS Object with certain operations. Object.Keys() and Object.Values() are good to parse with if you just want the keys and/or values as well as doing some iterations over arrays from an object.
Ramamurthi Iyer Tue 10 Dec 2019
Hi,
We are making a call to an Nhaystack service which is running on Niagara 4.8 workbench. We have sites, equipment(AHU) created on a Demo station
API Call: https://tridium.dev.iot.synchronoss.net/haystack/read?filter=equipRef
Following is JSON Payload from the response: I have 2 questions:
cols
field from the API response"name": "dischargeAirFanCmd"
. I need to have a value assigned to this column "dischargeAirFanCmd" as the value of the column "curVal".Is that possible as per API specifications?
{
}
Richard McElhinney Thu 12 Dec 2019
Hi Ramamurthi,
For your first question I have reviewed the REST API specifications as documented on this website and I couldn't see any reference to the server response being able to exclude specific columns. Therefore this will not be supported in nhaystack. If you wish to do this you would need to do some processing of the response grid in your client before presenting the grid to the user or the next step of your process.
For your second question I'm not sure how to achieve what you want. When using the control points in a Niagara station the value of the
out
slot is automatically applied to thecurVal
tag via implicit tagging. In nhaystack there isn't a configurable option to change where the value of theout
slot is set.Again, you could achieve this with some processing of the response on your client.
Justin Scott Mon 16 Dec 2019
For the exclusion here is a Javascript example of how I process the payload responses:
Most languages should allow you to point to a path on the DICT/Object/etc. JS you get a good bit of flexibility as it treats JSON like a JS Object with certain operations. Object.Keys() and Object.Values() are good to parse with if you just want the keys and/or values as well as doing some iterations over arrays from an object.