Hello, and thanks for watching. This is Todd Baginski. I'm a Microsoft MVP
and Partner and CTO of Canviz Consulting. In this video I'm going
to take you on a deep dive in PowerApps and show you how to find
available meeting times for meeting attendees, and also how to build
a user interface that shows you people's availability
so you can schedule meetings very quickly where everyone's able to
attend. To demonstrate these patterns, I'm going to use the meeting capture PowerApp
sample template. You can get the same exact PowerApp sample
template from web.powerapps.com.
I've already installed it and I have an open here
in the PowerApps editor. I encourage you to watch the other videos I made about this
sample template as well. I have a video that shows you how to install
it, another one that gives you an end-to-end demonstration of all the functionality in it, and
another one that deep dives on another pattern and this one regarding how to export to OneNote.
Okay, so I'm going to now put the PoewrApp
into preview mode by clicking the play button in the top right corner and walk
you through the scenario that shows you how you get to the functionality
that shows you how to find meeting times that are available for people
and just walk you through the process here before we dig into the code.
So, when you first start the app
meeting capture app shows you the upcoming meetings on your calendar here so
you can actually swipe your way or scroll through these meetings here.
Once you find meeting you're interested in, you click it selects start meeting at that
point to our apple load all sorts of metadata about the meeting and pre
populated here and then you can fill out notes and create tasks and things like that
as well when you're all done you click finish and save.
At that point you
can export to wherever you'd like this information to go.
For the purposes of this demo I'm just going to export it as
a single email here to myself so I can get to the next part of the puzzle here which were really
interested out and that is the schedule a follow-up meeting button right here.
So, here is the capability we have that allows you
to find available meeting times for attendees.
So, as you can see here we have seven different people who are
in this meeting and down here at the bottom I can put in a search and search
for other people in my organization as
well like that and then you're able to find those people inside
of your org if you're interested in building a active directory people
picker control like this encourage you to check out the video I have my utwo channel about it.
The next thing you're going to do to do the follow-up meeting as you're actually going to have to give
it a subject.
So, here is the subject of the meeting invite that
will go out and outlook and there is the description that
we'll head out in the body of that email.
So, now I'm going to click find available times
and here it automatically picks today's
date and the range of the current working day here and
then the duration for the meeting when I click find
available times at the bottom uses these parameters as well as the people I selected
on previous page to determine who is available and who is not
available at every single time and that time range based on
the meeting duration increment you picked here so here you can see I got a hundred
per cent of people can attend today from eleven, eleven thirty but as
day unfolds that ability goes up and down at different times?
We can also change the parameters
over here click find available times and watch this refresh again.
We're all done and we select the time
slot then we can click send invite and the apple actually send
an outlook calendar invite for that particular meeting but what we're interested in here
and this videos how did we find out who was available at
these this these times for this duration on this date and then how did we
build really nice-looking gallery like this to allow you to easily
find people and times that work to follow-up so let's start
over the code and see how that's done now first thing to do is click the x in the top corner
here to return edit mode now this pattern that I just followed of going
into a PowerApp running it getting the page that has the functionality I want while
and preview mode and the editor and then coming back into
edit mode is a really good way that you can dissect any our
app especially these PowerApps simple templates on web
dot our apps dot com so you can learn how they work
and more about them so as we come in here?
I noticed that when I clicked find available times and you did
too that's when we actually did the search and populated
the gallery so let's start by clicking on the find available
times button here and inspect the code in the on select method there.
The first thing you'll know.
Is that we do a clear collect function if you're new
PowerApps, clear collect means that you're going to create a new collection and you're going to
clear out anything inside of the collection so it starts fresh when you create.
Notice what I click inside of it to top it tells you what I'm putting in
is the arguments or the parameters. The first one is the name of
the collection. I'm going to call this meeting times.
Then I'm going to add columns to it and inside of added
columns the source of the columns that I'm adding is actually
my call out to the Office 365 connector. If
we look under view data sources.
We can see office three sixty five named right here.
That's our outlook connector so anytime you call on a connector in
code it's going to have the exact same name in code as it does in the data pain here.
So, back to our button to find available meeting times now we can see that that's the
office three sixty five outlook connector and we're going to call the function on it called
fine meeting times.
Find meeting times as you can see at the top involved
here is expecting these different arguments were telling it
the maximum candidates in this case we say fifteen minimum
tend the percentage here so it's telling tell me
give me back whether someone can at ten and has zero
percent chance or a hundred percent chance so we can calculate their availability.
The meeting duration this is how long the meeting should be or should
last and notice the purple here under meeting duration selection you
can see that correlates to this control here.
So, we're pulling out the amount of minutes from the selected value and that control.
The meeting should start at and here you can see meeting range start
range that's the orange box behind it the n box
is buried right now but if I minimizes here's the blue that's the
end time that we're passing in both cases you'll notice here we do a
date add convert to use UTC with two minutes and then we
turn it into a text value so that can be passed is this parameter
finally we're passing in the required attendees.
The required attendees is a concatenation of the follow-up meeting
times.
To maybe wondering where did follow-up meeting times come from let me show you that now.
Follow up meeting attendees is a collection we built on the previous
Remember when I showed you all the different people who are in that meeting that I wanted to
schedule the follow-up with that's where the collection comes from if you
go to file collections and you look at follow-up meeting
attendees here now you can see the different people that are actually represented
underneath the hood here in our collection that we picked in our user interface.
So, what we're doing is we're concatenate in here?
The this particular collection and then adding
in the user principle name there and concatenating them with
some a colon in between them
that's the format that we need to take to pass in required attorneys.
After we do the adding of columns there the other thing that we
need to pass soon there not just sir source is the
start time and the end-time so essentially what this is going
to tell us is all the different people and their availability
for meeting times and their suggestions that come back from this call it the
connector combine with the start in the end time of the meeting time slot
so if we look at meeting times because of already run this code.
This particular collection is
also already populated I can go back and look at collections
and head over to the meeting times collection right here.
And, now I can see this is a very deep nested collection it has
the confidence levels of each meeting time that come back as you can see
a hundred sixty six again, down to fifty.
The attendees who are available in there,
for example, I can dig in and I can see these two people
were free but this person was busy and who was that was
steven so when I come back and I take a look at that in
the user interface that should make a lot of sense because here we
had a hundred-percent available and that collection but then the first one I looked at it sixty
six percent steven was one of the people unable to attend?
So, now you can get a feel for how that collection
is actually built up and everything in it with the office three sixty
five connector so now that we have the data back from the connector how do we bind it
up to be such a cool looking gallery like this to make it easy to find out who can and can't make
it what's the percentage of availability and give the ability to actually
selected?
I'm going to pick on the available times gallery here.
And, the first thing I'd like to point out as its data source that's the items property we see
here at the top notice it's the same collection called meeting times.
Were sorting this one by the confidence column
descending and by the start column a sending.
So, that means that the more confident we are that we have a
hundred-percent attend the availability put into top of the list and then after that.
Put the start time so that it flows in chronological order.
After we've done that to bind the data let's click on the layout here
a blank and take a closer look how we bound up all the columns and controls.
The attend the availability text is this text that the top that
says one hundred-percent the tend the availability here
we're simply taking the confidence column and
we're rounding it so that there's only one decimal place and then we're
displaying so you can see as you look at the top here
in the code as well as what we have an user interface that's pretty simple binding.
Can't attend is a little bit more complex?
Here basically what we're doing is we're filtering out.
The items attend the availability where
they're ville ability is not equal to free so that means that person
can't make it and then we're going to put a comma on it and we're going to look up inside
of the follow-up meeting attendees collection we looked at before where they're user
principle name is equal to the attendees email address display name.
We concatenate those together and the mit is used to tell us to start looking at
the third character in the string so essentially
what we're building up out of that is the list of people.
That you can see right here in the unable to attend section.
The return back to the gallery here
there's a couple more data points we bind.
The next one is the select follow-up time.
this is essentially our button right here that says eleven am eleven thirty
for the top one and the list.
Here you can see this is very simple.
What we are doing here is when you select it, it's taking
the start time for this item and the end time for this item and
it's setting them to these variables.
These variables are used when you click the button actually
send the meeting invite so it knows which time you picked.
The other buttons in here are just
text values and a graphic
that sit at the top of the
row here that indicates someone is unable to attend.
So, that's pretty much it as you can see it really comes down
to one call to the outlook connector here to return who
can and cannot attend a meeting based on their availability. It all
happens right inside of there and then the more complex pieces - some of that
dating binding we saw as well. We hope that this app comes in really handy for you. It's one of
the favorite ones of mine that we have developed because I use it all the time and
it's just great for following up on meetings and taking notes
on them and exporting information from meetings to all different
places. We hope you find it really helpful too and you can use these patterns
on other PowerApps you develop as well. Thanks for watching the video I'll see you next time.