Hello my name is Todd Baginski I'm a Microsoft MVP and the CTO of canvas
consulting and this video I'm going to give you an end-to-end demonstration of
the expense report power app sample the expense report power app sample allows
you to submit expense reports with multiple line items there's also a
Microsoft flow hooked to the backend that sends notifications when you have
submitted an expense report for approval and also sends an email to the person
who's supposed to approve your expense report to allow them to approve it in
this video I'm going to demonstrate all this functionality to you to begin after
you have installed the expense report in your power apps environment you can
navigate to it in the apps page like you see here on web power apps calm
simply click the ellipsis for the row of the power app corresponding to the
expense report and click open when you open the expense report power app it'll
look like this the first time you open it in your environment you will not see
any data inside of this powerup but I've added a little bit of sample data to
give you a tour of some of the functionality to begin at the top we
have a summary that displays the total value of open expense reports and how
many there are so I have one open expense report here but it does not have
any line items associated with it so it's value is currently 0 I also have
one as you can see pending expense report the pending status means it's
pending approval and it has been submitted so I have one submitted for
716 dollars and 78 cents we also have the approved summary here at the top
there has been one expense report approved for $15 you can click the
different tabs here to browse through the different expense
reports so here's the open tab with the February expense report the penning tab
the approved tab and then the all tab which shows me all of the expense
reports we also have a button here that allows you to sort by date if I click
this you'll notice the dates are now in ascending order but if I click it now
they they are in descending order so that button allows you to filter or part
of me sort the values you see here speaking of filters we also have a date
filter when you click this filter button like this it opens a new page which
allows you to specify the start and end dates that you'd like to filter by here
I have my start date as January 1st this year and the end date as the end of
February this year if I change this for instance to February and apply it now
you can see when I go to view all I only have one expense report here however I
still do see the roll up of all expense reports so this filter just applies to
what you're seeing in the view of the grid here I'm gonna go and change that
back to the date I had before so we can see them all again and now we have all
of them in view I'm going to give you a tour now of what it looks like to add a
new expense report and line items to it and then go through the approval process
to create a new expense report simply click the plus icon in the top right
portion of the power-up this brings up the create new expense report form here
I can select which period this expense report applies to for the sake of this
demo I'm going to use today's date as my expense reporting period and then I will
give it a title
I can also select my approver here when you start typing in names it
automatically looks up in Active Directory the people associated with the
name you've typed and allows you to select them I can also choose my cost
center here these cost centers come from value inside of the SharePoint list that
this particular power app is tied to
when I hit create it will create my new expense report and you can see all the
data about it here if I come back and look at my SharePoint list I can see the
three expense reports that I showed you when I originally opened the app now
that I created a new one if i refresh the page
I will now see the new list item that I created in SharePoint via the power app
if I look at the line items in here you'll notice I have four line items for
my previous expense reports I'm gonna go add a line item now to my
new expense report and then we'll see it appear here in the list as well
to add a new line item I click add new line item here I picked the date which
it occurred give it a description pick a category for it these categories also
come from the SharePoint list in a choice column where you can specify them
without having to write any code and affect which categories people can
choose from I can put in the cost and if I hit save it'll take me back to the
screen I saw before if I hit save an ad new line item it will allow me to add
yet another line item here very quickly
so I will add in another line item and this time I'm going to click Save and
now I'm returned back to that expense report so this is the my power apps
expense demo expense report I'm submitting it on the 22nd today it has
the expense period of the 22nd through the 22nd however in your company maybe
you submit on a monthly basis for expenses or maybe you do it per trip you
take so this period could equal the duration of either one of those if I
wish to edit this data I can click the edit button and open back up the form
and change those values if I wish to edit my line items or add more I can
click on one of the line items to edit it or click on the add new line item to
create a new one for instance if I wish to edit the cost of my lunch here I can
click on that expense report and put in a new value here clicking update commits
that information or the SharePoint list and now the information is also
reflected in the expense report now if I go back to the main page here I can see
that I now have another open expense report and my summary value at the top
reflects that as well I'm going to open back up the expense report I just
created and now I'm going to submit it for approval remember I made these
approver myself here so that I can show you the emails that the flow sends out
for approval next I will click the submit button to submit this expense
report for approval notice as soon as I do that we now have two in the pending
category and if I click on pending we can now see the status of this expense
report is pending coming back to the SharePoint list and refreshing this page
I will see the status column right here from open change depending
in the line items list notice we had four but I added two before as I worked
with the power up so if i refresh this page now we'll see a total of six line
items reflecting those two new line items I created right here today
notice the report ID 109 in this case of the one I'm working with this is a
lookup column that goes back to the expenses list we're here I have an ID of
109 that's how we tie the line items to the expenses after I submit my expense
report a flow kicks off which allows me to facilitate approval on that expense
report here's the email that I received from Microsoft flow to allow me to
approve it you can see it has the name of the expense report and a link to the
SharePoint site with that list item as well as a button to approve or reject it
so I can click on that link go see more details about it and then approve or
reject it I can also look at it inside of the power app before I decide to
approve or reject in this case I'm just going to approve it first I click the
approve button this brings me to a new web page that you see right here here it
shows me the detail of this expense report again it gives me a link to that
expense report and says I've chosen to approve it here I can leave comments
about my approval
when I click the confirm button that information will be sent back to the
flow and the flow will in turn send an email and also update the items inside
of the SharePoint list to mark them as approved another email that I received
was the fact that my report had been submitted here we can see the ID of the
expense report 109 that I've been working with as you can see right over
here again on the right side of the screen and that told me that my expense
report had been submitted for approval
finally I have the email here that indicates my expense report was approved
and I also have a link to go straight back to it as well it also shows me the
comments that the approver made to approve my expense report in the event
that somebody had chosen to reject the expense report I would see their
comments here and the expense reports status would move from pending back to
open returning to the power-up and refreshing the page will reload the data
inside of the my expenses power up as we move in here and go to the approved
column now I can see that my expense report that I just submitted was indeed
approved opening up the expense report here also shows the comments that the
approver made when they approved my expense report had it been rejected and
set back to open the comments that person put in when they rejected it
would also appear here finally as we look at the SharePoint list here we can
see that the status was pending the last time I looked at this page if i refresh
that page we can now see that this has been approved to finish the demo I'd
like to show you the flow that ran behind the scenes
to facilitate the approval process here we can see the approve expense flow if I
pop this into edit mode I can show you how it works the flow is kicked off when
we submit for approval inside of the power app it then uses the get items
function or action I should say to query the expenses SharePoint list and return
the items it then loops through each item and it starts an approval for the
item here you can see the approval action and the different information
that shows up inside of the email after the approval is sent then we come back
and we notify someone that their expense report has been submitted remember when
I showed you the email I got that said your report 109 has been submitted
that's how we got the ID in there next we check if the response from that
approval process was approve if so then we will send an email to say that the
expense report has been approved and so you saw that a same email as I
demonstrated in the demo earlier finally we will then update the status for that
SharePoint list item to approved and we will also include the comments that came
out of the approval action in the event that the approver rejected it our
response will not be equal to approve and we will notify the person the same
way we did when it was accepted that it has been rejected and we will then as I
mentioned in the video changed the status of the item back to open and
record the comments that were left by the approver if we close this flow and
we inspect it closer I can take a look at
the run that just happened here I can see that the flow stepped through all
the pieces of the process because they all have the green checkmark next to
them and that is how the flow works to facilitate approval of the expenses in
the expense report powerapp thanks for taking the time to watch the video I
hope this powerapp comes in handy for you in the real world as well as a learning
tool thanks a lot