Filter Events By SingleValueExtendedProperties with MS Graph SDK - microsoft-graph-sdks

I have created an event on an Outlook calendar using the MS Graph SDK, and I have successfully added a SingleValueExtendedProperty. When I try to retrieve only those calendar events with that SingleValueExtendedProperty, the filter does not work. I do get the property back on the event I created, but I also get back other events. The .Expand seems to be working, but the filter is not. This is my query:
var events = await graphClient.Me.Events
.Request()
.Expand("SingleValueExtendedProperties($filter=id eq 'String {dae3342f-dd63-4e88-a95e-5d7d26073b3e} Name EventId')")
.OrderBy("createdDateTime DESC")
.GetAsync();
I have tried with and without HTML encoding the spaces and brackets, with the same result either way.

Related

How to re-execute the query script of an App Maker Datasource

Goal
Use App Maker to collect User Birthdays and display only the Birthdays this Month.
Issue
I have a data model, persons. In that model are two Datasources, the default persons and a second birthdaysThisMonth. The datasource query script in birthdaysThisMonth properly runs and returns only the birthdays this month from the persons model.
However, when I change a birthdate in the persons datasource, the birthdaysThisMonth datasource remains unchanged, e.g., the Query script in birthdaysThisMonth is not re-executed.
To change the birthdate, I select a new date from the date picker, and the new value is shown in a table. I am not using a submit button, I see the change when the date picker looses focus.
What I've Tried
This script is executed as a Query script in the birthdaysThisMonth datasource which is not set to Manual save mode. It returns the records I want.
function setBirthdays() {
var calcRecords = [];
var personsRecords = app.models.persons.newQuery().run();
for (i=0; i<personsRecords.length; i++) {
var id = app.models.persons.newQuery().filters.Id._equals = i;
if (personsRecords[i].birthdate.getMonth() == thisMonth()) {
var calcRecord = app.models.persons.newRecord();
calcRecord.emailSecondary = personsRecords[i].emailSecondary;
calcRecord.birthdate = personsRecords[I].birthdate;
calcRecord.Id = personsRecords[i].Id;
calcRecords.push(calcRecord);
}
}
return calcRecords;
}
Question
How do I re-execute the query script in birthdaysThisMonth when the data in persons has been updated. How do I trigger the query so it reevaluates the data in persons and filters accordingly.
Using Events and onAfterSave seems promising, but I haven't found an example of this.
BTW
I'd like this work to happen on the server side if possible.
See Markus Malessa's comment for the answer.
Unfortunately you can't use server events like onAfterSave to trigger reloading a datasource on the client, so your proposed solution won't work. It would seem that your only possible solution would be to make your persons datasource a manual save datasource, in the form where you change the birth date you will need a 'Save' button that calls widget.datasource.saveChanges() and in that function incorporate a callback that will reload your birthdaysThisMonth datasource
The way I'm attempting to push/pull data isn't great. Looks like Manual Mode provides the types of features I need.

CalendarApp.getDefaultCalendar().getEvents() returns events which can't be accessed by CalendarApp.getEventById()

I am building an Apps Script web app that gets a list of calendar entries from my default calendar, stores the Event ID and then later tries to retrieve that event to do something with it.
The problem I have is that some events retrieved in the list cannot later be retrieved by ID.
Here's some (simplified) code that I'm using.
//I first get a list of Events from the default calendar
var eventList = CalendarApp.getDefaultCalendar().getEvents()
//I then iterate over the events saving the event ID for later
eventIdList = [];
eventList.forEach(function(event) {eventIdList.push(event.getId());}
...
//Later in the program I need to get the details of that event
// so I try to retrieve that one Event by its ID
event = CalendarApp.getEventById(eventId); //returns null for some events!
There are specific events that consistently return null when I try to retrieve them by ID. some are formateed exactly like "normal" event IDs that generally work:
5v2grutu605rvvaqis91fi6u6b_R20180404T210000#google.com
And Other IDs look nothing like I've been led to expect:
040000008200E00074C5B7101A82E008000000001022931735E6D3010000000000000000100000000A762C897D92624C8F7D59B232FEEED2
Are there different kinds of events that need to be retrieved differently by ID?
Are there more formats for the Calendar Event ID that are not well known or documented yet?
Help?

get the innertext with in a html dom using vbscript in UFT

I am trying to verify if TravelerID got created and showing up in the Add Traveler table.
AddTraveler Image
I was able to capture the webelement
ObjectRepository of the AddTraveler
To capture the innertext I need to create DOM object first. Then I can use the methods of the DOM object.
This is how I am capturing the DOM object
resultsObj = Browser("Manufacturing Milpitas").Page("Manufacturing Milpitas").Frame("Results_AddTraveler").Object
Here is the tricky part. I am not able to capture the inner HTML or any method of that DOM object.
The Method I have to use is getElementById, but this webelement doesn’t have ID it only has class.
Any ideas or suggestions?
To find innertext use the following code
Browser("Manufacturing Milpitas").Page("Manufacturing Milpitas").Frame("Results_AddTraveler").WebElement("WebTable").GetROProperty("innertext")
Your object in the object repository has the previous TravelerID under innertext property, so UFT is unable to identify the object every time a new TravelerID is generated.
You do not need to go with that object. Capture Webtable object and use GetCellData(Row,Column) method to get the value from "Traveler ID" column.
Msgbox Browser("Manufacturing Milpitas").Page("Manufacturing Milpitas").Frame("Results_AddTraveler").WebTable("WebTable").GetCellData(Row,Column)
'Here, Row = 2 and Column = 2
If you want to get the column number during run time, use the below approach -
Set ObjWebTable = Browser("Manufacturing Milpitas").Page("Manufacturing Milpitas").Frame("Results_AddTraveler").WebTable("WebTable")
iColumncount = ObjWebTable.Columncount(1)
For i=1 To iColumncount
If ObjWebTable.GetCellData(1,i) = "Traveler ID" Then
iColumnNumber = i
Exit For
End If
Next
Msgbox ObjWebTable.GetCellData(1,iColumnNumber)
Set ObjWebTable = Nothing

How to replace chrome.tabs.onSelectionChanged deprecated method?

I need to get data from the tab the user is leaving (switching on other tab or going on other program).
But chrome.tabs seems not providing an event allowing that..
Before there was apparently chrome.tabs.onSelectionChanged (not tested) but it's deprecated.
And other event are giving the data of the new tab not the one the user just left...
I try also jQuery $(window).blur event, but i have to make a call to the chrome.storage of the tab left by the user (i create a storage for each tab named by the tab id) and i did not get the response of storage in time with this event (the result of the storage is used in a if() to know if i have or not to display an confirm box.
Someone could help me ?
Thx !
To detect a tab change, just use chrome.tabs.onActivated. Since you're interested in the previous tab, store the result of the event at the end of each event. For instance, like this:
var storedWindowInfo = {};
chrome.tabs.onActivated.addListener(function(activeInfo) {
var windowLastTabId = storedWindowInfo[activeInfo.windowId];
if (windowLastTabId) {
// Do something with previous tab, e.g. send a message:
chrome.tabs.sendMessage(windowLastTabId);
}
// Update ID of currently active tab in the current window
storedWindowInfo[activeInfo.windowId] = activeInfo.tabId;
});
Note: Only the tabID and windowID are provided to this event. You need to issue chrome.tabs.query to get more information, such as whether the tab still exists, its URL, etc.

getTag() method not properly working for google apps script

What i am doing in writing a script that lets the User interact with a data table. Every series that the user chooses creates a button, and then plots the series on a graph. if the user click the button it rooms the series. All there the data is stored in a hidden JSON string. the columns, or series that the user whats to see are stored in an array that i call index, it is also a hidden JSON string) Each button is connected to its own client handler, which has a
.forTargets(the index i was talking about).setTag(to the corresponding column in the data array)
and they are all connected to the same server handler. So when the button is clicked the client handler sets the tag for the index to the series that it is supposed to be removed. Now the server handler will run it get the index by ID and get the Tag. This is were it goes wrong. The tag is always null.
The first thing i tried was to see if my client handler was not working properly. So i set the tag of the index to some number, but the getTag method in the Server handler still returned null.
idk, but maybe Tags are not saved in the UI instance??
Below is the first bit of the Server handler.
function clickServer(e) {
e = e.parameter;
var app = UiApp.getActiveApplication();
var master = JSON.parse(e.dataTable, "reviver");
var index = JSON.parse(e.index, "reviver");
var hidden = app.getElementById("hiddenIndex");
var tag = hidden.getTag();
I think the issue you are meeting is more related to timing : handlers are called simultaneously, this is true for client an server handlers as well, that means that if the client handler changes a hidden tag value this change happens too late for the server handler function to 'see' it. What you should do is create a separate button to trigger the server handler that the user would use after all the other parameters where set.
This very same method is used in the known workaround used to get radioButtons value
Also, why do you use tags on the hidden widget ? you could use it with direct access by setValue() and e.parameter.hiddenName since they are already invisible by nature... ?
Note also that you can set a value in client handlers as long a these values are defined inside the Ui instance (the do Get function) either by constant variables or by another client Handler in the same function, as shown in the before mentioned example with radioButtons... but that's only a detail.
In this context if you need to get a widget value (inside the doGet function) you should of course use getValue() to get the widget value as no e.parameter is available at this time.
I hope I've been clear enough, re-reading this I'm not very sure but.... just ask if something is missing ;-)
The tags values are passed to handlers via parameters. In this post this fact is explained in details.