Filter Graph OneDrive DriveItems using Item Type and createdDateTime - onedrive

I need to make two filters to get either all of the folders or all of the files within a date range using createdDateTime or lastModifiedDateTime in Microsoft Graph™ using OneDrive™ connection, but neither filters works.
Any help would be very appreciated.
https://graph.microsoft.com/v1.0/me/Drives/[drive-Id]/root/Children?$filter=Folder/Childcount $count ge 1
https://graph.microsoft.com/v1.0/me/Drives/[drive-Id]/root/Children?$filter=CreatedDateTime gt 2017-01-01T00:00:00.000Z and CreatedDateTime lt 2017-01-08T00:00:00.000Z

Unfortunately neither filter or even orderby don't work correctly on OneDrive :( You have 2 "workarounds":
Use delta api
Iterate through the drive items and then filter on the client side
Personally I found the 2 options easier to do for me.

Related

Search repos with GitHub API using date query

If I make the following GET request to the GitHub API, I get about 58 entries:
https://api.github.com/search/repositories?&per_page=250&sort=updated&order=asc&q=%22github-octocat%22
However, the following with any date parameters return 0 entries:
Created since date: ( created:>=2010-09-01 )
https://api.github.com/search/repositories?&per_page=250&sort=updated&order=asc&q=%22github-octocat+created:>=2010-09-01%22
Date range: ( created:2012-08-13..2020-08-14 )
https://api.github.com/search/repositories?&per_page=250&sort=updated&order=asc&q=%22github-octocat+created:2012-08-13..2020-08-14%22
In the GitHub docs, under the section Constructing a search query, the syntax is outlined as such:
SEARCH_KEYWORD_1 SEARCH_KEYWORD_N QUALIFIER_1 QUALIFIER_N
Thei GitHub docs at Search by when a repository was created or last updated outlines date formats like the two above, and Query for values between a range outlines valid combinations of them. I suspect these examples are not meant for this use, as the examples use URLs intended for browsers, such as https://github.com/search?q=case+pushed%3A%3E%3D2013-03-06+fork%3Aonly&type=Repositories, instead of api.github.com, which is confusing too.
I'm trying to apply the patterns shown in the following resources in order to get a range of dates filter:
Github API call: filter by committer-date, answer by Poonacha
Get issues on a date range from Github enterprise API, answer by Al Neill
Any pointers greatly appreciated.
Even though the GitHub docs outlines the syntax as such:
SEARCH_KEYWORD_1 SEARCH_KEYWORD_N QUALIFIER_1 QUALIFIER_N
the parameters for date or similar, are not valid unless placed outside the q parameter. Instead of including date qualifier inside of the double quotes (shown as %22 below):
q=%22mysearch+pushed%3A2017-09-01..2020-10-01+sort:updated%22
Pull them out, and add them after the closing quote of the q parameter:
q=%22mystring%22+pushed%3A2017-09-01..2020-10-01+sort:updated

Is there any example or sample code for the find and filter feature in Cytoscape JS

I saw in cytoscape application we have features like find and filter by keywords and degree. I tried a workaround following the original docs. Here you can see the demo webdemo.intolap.com/cytoscape (view-source for the source code or snippet). The filter works well partially. Example, "apple" will display apple and it's connected nodes (1st level) just what I am looking for.
But the problem I am facing is about resetting the graph and filter again with a
different keyword. It seems the filter function does not work after the text box is cleared and then keyed in a different keyword.
I mean when I clear the text box, it resets the graph to original which is correct. I did that using an init() function which reinstates the graph. But then if I search for "Ball" filter does not work. Any help please. Thanks!
actually there is a reasonably good explanation in the official docs here, but to be honest, I too struggled with this feature at first:
Basically, you can filter the specific collection you want to search by just inserting a filter query. So if you want to filter all nodes, you can use this:
cy.nodes(filterQuery);
If you want to filter all elements, just call this:
cy.elements(filterQuery);
If you want to make it easy, you can use this short version (short for cy.filter(...)):
cy.$(filterQuery);
The filter query itself is not that hard, you can do this (assuming that you have a node with the id "first" or an attribute like nodeColor "#2763c4"):
cy.$('[id != "first"]');
cy.$('[id = "first"]');
cy.$('[nodeColor = "#2763c4"]');
cy.$('[weight > 50]');
Additionally, you can specify the target collection within your filter query like this:
cy.$('node[id != "first"]');
Lastly, if you need complex filtering, you can use a function to apply that logic to the filter, for that just do this:
cy.$(function(element, i){
return element.isNode() && element.data('weight') > 50;
});
Sounds like you are trying to cy.filter on a cytoscape instance that no longer exists at that point. That's why it works the first time, but not the second time (after you reinstate the graph, which probably means destroy & create).
You need to make sure you point your filter handlers to the active cytoscape instance.

AtTask API order by date?

I've gone around in circles on the web trying to find any relevant information, including the API Docs, for ordering results by ASC/DESC order...
/task/search?name=NAME HERE&percentComplete=0&fields=plannedCompletionDate,project:status,project:name,project:plannedCompletionDate
I want to be able to have my results ordered by plannedCompletionDate instead of having to do it in code.
you can do this by adding
plannedCompletionDate_Sort=asc
so your call would be
/task/search?name=NAME HERE&percentComplete=0&fields=plannedCompletionDate,project:status,project:name,project:plannedCompletionDate&plannedCompletionDate_Sort=asc
If you need to sort by string (i.e. project name) you can also use name_Sort=ciasc to get case insensitive results:
/project/search&method=GET&status=CUR&name_Sort=ciasc&fields=name
Credits: Blue Agave and Hamlet Hakobyan

Is it possible to compare 2 dimensions in a Google Analytics query filter?

I'm just starting out with the Google Analytics API and am wondering if it's possible to compare two dimensions via an operand in the filters I pass in the query. And by wondering I mean I've tried it, but have had no success.
Specifically I'm trying to compare 2 custom variable values. One holds the user who created a post (customVarValue3), the other the user who is viewing the post (customVarValue5). I want to get the pageviews only for the visitors who are not also the creator. The filter looks like this (without urlencoding applied):
ga:customVarValue3!=ga:customVarValue5
The full query (url encoded) looks like this:
https://www.google.com/analytics/feeds/data?ids=ga%3Axxxxxx&dimensions=ga%3AcustomVarValue1%2Cga%3AcustomVarValue2%2Cga%3AcustomVarValue3&metrics=ga%3Apageviews&filters=ga%3AcustomVarValue3!%3Dga%3AcustomVarValue5&sort=-ga%3Apageviews&start-date=2012-02-09&end-date=2012-02-23&max-results=50
However, it returns the same results (and I know there are results where ga:customVarValue3 == ga:customVarValue5).
Probably it isn't possible, but I just wanted to see if anyone knew how to achieve this or has a workaround or something.
No, it is not possible using the GAv3 API in its present state. You can, however, get all the results by using the specified two custom variables as the dimensions for a report, and programmatically filter out the unnecessary results.
Some simple construct like
for(var item in collatedResultsListwithDimensions) {
for(var row in item.rows) {
if(row[0]!=row[1])
newResultRows.push(row);
}
}
Now your newResultRows will have those rows where row[1]!=row[0] assuming the two custom variables you mentioned are the first two dimensions.

google analytics API, how to extract pageviews for a specific page?

Google Analytics API: how to extract pageviews for a specific page?
I tried using something like
ga:pagePath=~page.php%3fid%3d44 (page.php?id=44)
but it doesn't seem to work... I get "no results found" where I have 20 pageviews for sure
UPDATE
I think I found the solution
ga:pagePath==/website/page.php?id=44
for some reason I had to include the complete path and ==
To use a partial path to match for a page in filters you should use
ga:pagePath=#page.php?id=44
=# tells ga to match a substring.
What you were originally using was incorrect for this.
I think your problem is that you put the hex version of the ? and = characters into your query, which doesn't match how Analytics stores the page paths. If you change these to the normal characters it should work:
ga:pagePath=~page.php?id=44
Your other solution should work as well but is a bit more inflexible in case you wanted to tweak the query to return other pages.