this API but it is fetching only abc fragment values but not xyz values. I also tried custom query but that is also not working. Can we use custom query on measurements? If yes could you please tell me how can i carry out my use case with this? OR could you please tell me how can i achieve this use case with any other way.
Hi,
if you want to query multiple measurement series in one call, also take a look at the retrieve a list of series and their values measurement endpoint.
It accepts a comma separated list of series-names: GET /measurement/measurements/series?source=...&dateFrom=...&dateTo=...&series=A.abc,B.xyz
The series endpoint won’t give me the latest value, it will only fetch the values between a time period. even if i just set dateTo as current time i have to query the series to find a value if its not present for some time like for example if the value i am searching for was entered 2 months ago, then i have to search the series endpoint till that time. I could do the same thing with measurement endpoint as well, but i dont want it to be like that. I want to fetch directly the latest values itself.
Is it possible to use custom query in measurements?
Also, could you suggest any other way?
If you only want to retrieve the latest measurement you will need to perform one request per combination of fragment/series.
You can use a pageSize of 1 in this case as you are only interested in the latest value.
So in your case e.g. one request to: /measurement/measurements?revert=true&dateFrom=1970-01-01T00:00:00.000Z&pageSize=1&valueFragmentType=A&valueFragmentSeries=abc
and another one to: /measurement/measurements?revert=true&dateFrom=1970-01-01T00:00:00.000Z&pageSize=1&valueFragmentType=A&valueFragmentSeries=xyz
There is no endpoint to retrieve the latest value of different measurement series in a single request as of now.
Okay thanks for the confirmation. Could you please also tell me if it’s possible to use custom query on measurements like we do in inventory. like query = $filter= $order by creationtime desc something like that