How to get alert list of context or context mask for certain time in AggreGate - iot

Good afternoon! I'm trying to get a history of all alerts on a single device using the expression: callFunction("events","get","users.admin.alerts.*","alert","dc()=='users.admin.models.device1'&&({env/level}==4||{env/level}==3)",dateAdd(date(year(now()),month(now()),day(now()),-3,0,0),(dayOfWeek(now())==1?-6:((dayOfWeek(now())-2)*-1)),"d"), now())`

Related

How to query 'history' field in Team Foundation Server (TFS)?

I am trying to capture the history of changes when a user story is moved from one iteration to another.
I am trying to query in TFS and using the history field, but don't know what values to put in the value field to capture when a user story is moved to a new iteration. See image below.
I am trying to capture the history of changes when a user story is
moved from one iteration to another.
Unfortunately you cannot capture the information as the History filed is not the real change history for all actions. It just records the Discussion History.
And the work item query is to return work items which matched the given conditions from TFS but not the specific history information.
If you just want to get the real history (iteration change information in your scenario) for a specific work item, then you can call the REST API - Get Work item revisions
If you want to filter the work items which have the specific discussion words, then you can specify the words as the value of the History field. Reference below screenshot:

Siri Shortcuts how do I sequence the results from JSON in a Siri Shortcut?

I'm using the ptv api call for departures and can successfully return back three results. I'm trying to get Siri to dictate these to me in order but am not having much luck.
When the api is called it returns a bunch of information in an array for however many services you specify (three in my case), but I only want one of the lines to be dictated (scheduled_departure_utc), not the full array.
And I want to pull just this one line out of each of the three blobs of data that are returned so that Siri says...
the next trains to the city are (scheduled_departure_utc),(scheduled_departure_utc),(scheduled_departure_utc). Where (scheduled_departure_utc) is a short form of time (8:28am, 8:38am, 8:58am) as an example.
Any ideas?

Microsoft Graph filter vs $filter

I am testing filtering using Microsoft Graph Explorer. I noticed odd behavior that I cannot figure out.
Using endpoint https://graph.microsoft.com/v1.0/me/events?filter=start/dateTime%20ge%20%272018-04-01%27 I get properly filtered data back.
However, using documented $ prefix, https://graph.microsoft.com/v1.0/me/events?$filter=start/dateTime%20ge%20%272018-04-01%27, I get nothing. There is no error, just no data coming back.
How do I query the data using the $filter?
You're not actually getting the results you think you are. When Microsoft Graph sees a query parameter it doesn't expect, it simply ignores it.
When you call /events?filter=start/dateTime ge '2018-04-01' it is simply ignoring the unknown filter parameter and returning you an unfiltered result.
When you call /events?filter=start/dateTime ge '2018-04-01', it is filtering out anything prior to April 1, 2018. If there are no events with a start after this date, you will get an empty array as a result.
I assume you're using the default dataset included with Graph Explorer? The default Graph Explorer data set's most recent event is 2017-11-16T08:00:00.0000000.
The reason you see results from the /calendarView endpoint but not the /events endpoint is that /events only returns single instance meetings and series masters while /celandarView shows everything within a date range. In order to avoid having to maintain a dataset with updated events, the demo data relies on a handful of recurring event entries.
Since events does not return individual occurrences of a meeting, you don't see any results from your query.
If you try this query, you'll see actual results:
https://graph.microsoft.com/v1.0/me/events?$filter=start/dateTime ge '2017-04-01'

Microsoft graph API: getting 5 next instances of recurring meeting

is there a way to query for next 5 instances of given series? I am querying using time-frame:
1. ask for all the meetings for next 7 days for all user events
2. Go over each event fetched and check if event has masterSerieId
3. Return matching instances.
This feels (and is) a bit painful.
Can i request next X instances of master series right away? I can't just simply or 'simply' get them based on recurrence rule, as some might have expired.
I could image I could ask for a year ahead and pass as a query parameter masterSeriesId and limit output with $top. Is that right approach?
Based on this document, you could call /events//instances – given a start time, returns all instances in the requested time frame of the meeting specified by the provided series master ID

How to implement infinite scroll with multiple filter on data that get from Firebase in Swift?

I'm using Firebase for my iOS application and I'm having trouble implement infinite scroll and filtering data together.
What I need to do is:
Display items with order/filter on multiple property (location, category, status . . .)
Implement infinite scroll when the user scrolled to bottom of the screen.
I tried to think about some solutions:
The first, I think that I'll query the data with the necessary conditions then limit the number of records by use queryLimitedToFirst(N), and increase N when need to load the next items. But because Firebase can only filter on one property at a time and it's also a waste to reload data. So, I was thinking about the second solution.
As approaches are suggested from Frank van Puffelen (Query based on multiple where clauses in firebase):
filter most on the server, do the rest on the client
Yes, exactly like that. I'll execute queryOrderedByKey, queryStartingAtValue, queryEndingAtValue to implement infinite scroll, pull down the remaining data and filter that on client. But there is one problem that is I would not have enough items to display for the user if execute filter on the client.
For example: each time run the query, I receive 10 items. After data filtering process on the client, I just left 5 (can be 0) items meet the conditions to display to the user.
I don't want this because user may think there is a problem
Can I please get some pointers on this? If I didn't structured the data properly, can I also get some tips there?

Resources