Transcript for:
Power Platform Business App Development

hello everyone RZA here in this video I will show you the right way to get started with building business critical applications with the Power Platform we will take a common scenario and expense reporting solution we will set up our own development environment use Solutions data ver tables take help of co-pilot build our application secure our data and a lot lot more so let's check this video out in [Music] action let's begin with exploring the right way to build business critical applications leveraging the Power Platform to build an app we start with power apps we begin with make. power apps.com that lands us us into an environment to begin with and this environment is known as the default environment now if you select the environment picker this will list out all the environments that you have access to a powerplatform environment is a space to store manage and share your organization's business data apps flows Bots and more the default environment is ideally best suited for personal productivity based scenarios now let's take a scenario here of an expense reporting solution that I would like to build for my organization I would like to build that in a specific environment now the simplest way to get access to a power platform's environment is by leveraging the power app apps developer plan which allows us to explore the Power Platform at full potential for development or learning at no cost and to create a developer environment head over to settings and go to the admin Center head over to environments in the admin Center this will only list the environments that you have access two and in here if you click new you can give a name for your environment I'll pick my region and the type of the environment that I will select is developer these are special environments intended only for use by the owner of the environment the owner is the user who is creating this environment I'll click next and then I will click save and this will begin the process of creating a development environment for the user once this environment is ready if I go back to make. Power apps.com the environment picker will now include my new development environment and if I select it it will swap the environment to my development environment and observe right here it clearly specifies that this is a developer environment and not meant for production use which is ideal for me to build my solution first and then deploy it into a production type environment where I can go and share the applications with my end users and whenever we speak about Alm the first thing you should be thinking about is Solutions this is where I can start creating my solution and start adding components into it now Solutions are used to transport applications and components from one environment to another so let's begin with creating a solution I'll give my solution a name I will call it expense reporting publisher now we've got default publisher options here but as a best practice I'll recommend going and creating a new publisher now what's a publisher the publisher of a solution where a component is created is considered the owner of that component and with a solution publisher we can also include a prefix which is a helpful mechanism to avoid naming conflicts so here I'll create a publisher with my initials give it a prefix and we can clearly see that any object that will get created in this solution will have this specific prefix associated with it I'll click save so this will create the publisher and now for my solution I'll pick my publisher that I defined I'll click create and this creates a solution and in this solution is where I can start creating canvas apps M driven apps custom Pages automations Bots security roles tables and data ver and a lot lot more the best practice is to always create any component in a solution however typically we end up creating things outside of solution context for example I go to make. Power apps.com and I say I want to create a canvas app or I go to Power automate and try creating a flow if you've created things outside of solution context we can bring it in solution context by going to add existing selecting the type of app or automation that you've created and then you can start bringing things into solution context now one of the new features that we can take advantage of is Solution by default now if I go back to the admin Center my developer environment for which I am an admin off if I select this environment go to settings product features we have the ability here to create new apps and flows in solutions by default so I'll go ahead and turn both these features on we also have another new Option called preferred solution this allows the maker in that environment to decide which solution is your preferred solution so any new objects that are created in that environment will land in that specific solution so I've turned these settings on I will click save back to power apps now if I go to Solutions I have an option here called set preferred solution and by default the preferred solution is the common data services default solution so this this I will now change to my expense reporting solution I'll also check the option to show preferred Solution on the solutions page my preferred solution is defined as expense reporting that means anything that I create outside of solution context in this environment will land in this specific solution I'll go back to home in developer type environments we also get the co-pilot feature which allows us to describe our app requirements in everyday words that's right here on the home screen experience if I was to start creating a table in data verse here as well I can simply describe my table by simply working with a co-pilot that lights up now why do I leverage data verse data verse is a secure scalable intelligent platform for Microsoft Power Platform and Dynamics 365 from a security standpoint authentication and authorization derived from Microsoft entra ID you can Define role based security you can secure your data down to the column level from a logic standpoint you can Define business rules workflows calculations formulas dat comes with Rich data types you can create complex relational data structures it's a scalable datab base plus powerful integration capabilities data importing exporting analytics and the magic of application life cycle management so let's begin with co-pilot to create our first table in data verse I've described my intent here with which is I need an expenses app I'll submit so AI co-pilot recommends a table for expenses with different types of columns here I can work with the co-pilot to change the schema of my table I will interact with the copilot to make some changes in my table I've said change expense ID to expense title which it has done I've asked it to remove move category amount and date next I'll say add columns for start date and end date you can see the different data types that are being assigned to the column expense title is of type text description is text area and my date columns are of type date and time so I've said create a choice column called expense status with values new pending approved and re rejected and I can confirm that by viewing the type of the column which is choice and here are my four choices now at this point I will go ahead and click create app so what copilot will do is it will create that table in data verse and create a fully responsive single screen canvas power app experience that will allow me to interact with that table remember the steps I've taken right now are outside of solution context but because I have Solution by default feature turned on and I set my preferred solution as expense reporting if I explore my solution you can see how the solution contains a table that got created through the process of me interacting with the co-pilot and this table gets that publisher prefix which is rdcore and here is the power app it's connected to the expenses table if I click edit I can see my columns my data I also have copilot here in the studio experience itself so I can work with the co-pilot to make further changes to my app and if I preview my app here it's a single screen fully responsive canvas power app experience that works on all device types and sizes here I have a gallery on the left where I can select expenses that are created in that table I can see the details I can edit the expense details just change the description on this one submit and that change will immediately be reflected in my data source I want to allow the user to add line items for a specific expense classic scenario where I need relational data one expense can have many line items so now comes the next step for me to create another table which I can do directly in the canvas Studio experience itself can go to data click add data and say I want to create a new table now here I can simply describe my table in everyday words and work with the code pilot once again to create a table I even have the option to upload an Excel file in this case I'll create the table myself so I'll say start with a blank table I'll give my table a name I'll call it line items the primary column I'll call it name description about the line item you can see that I have various various types of data to to choose from here I'll pick text area for description date I can even make Fields as required in the data source a line item needs to have a cost associated with it I can pick the currency data type for this one the category of the line item this I can make it column of type choice so I can Define my choices for for example food gas and miscellaneous we'll just save this one and I will click close this will go and create the table and connect it in my power app solution view now to create the relationship between these two tables if I simply select the line items table here we have an option here relationship many line items will be related to a single expense I'll pick expenses what's the name of that column I would like to call that column related expense and when I'm creating a relationship I can also Define which type of relationship I want to create in this scenario I'll create a parental type relationship meaning if an expense is deleted I would want the line items to be deleted so that creates the relationship if I go back to my line items table here and if I go to columns here I can add more columns I would want the user to upload a receipt I'll pick the type as file and an image I need another screen for line items I can simply say create a blank screen start with data pick line items and just like that I will get a second screen that I can rename to line item screen and this screen provides full crud operations create read update and delete in my line items table so for example if I click new this is where I can create a new line item now that relationship that I created which resulted in a lookup colum in my line item table called related expense I will add this now line items will be created for an expense so in my home screen here in this specific container here I will go and insert a button I will call this line items and when the user selects this I will simply navigate the user to my line item screen so if I click takes me to the line item screen now in the header where we have the text line items I'll go ahead and concatenate some additional text for which expense I'm adding the line items in my main screen my expenses are listed out in a gallery that I have renamed to expenses Gallery so in my line item screen in the header I can use expenses Gallery that's the control on my home screen do selected and Dot this exposes all the properties one of them is expense title I'm working on line items for expense one now in this container I would also like to add an option for the user to go back to the previous screen on select of this icon I'll simply use the formula back so starting from the home screen I can select expenses this one is expense one if I click line items I'm viewing line items for expense one if I pick expense 2 and go to line it items now I should be viewing line items for expense to now the related expense lookup is where that relationship is maintained this lookup column needs to have the value of expense two selected by default so for this data card which I will unlock it's default property I will set to my expenses Gallery do selected if I was to pick expense one and land on this screen now the related expense would be expense one and this data card is something that I can hide from the users view so let's create a line item this is a food related expense I'll put the cost pick the category pick the date and optionally I can also upload a receipt I've uploaded a receipt I'll click submit and this will go and create a line item now I've made quite a few updates to the app so always best to save the app and go ahead and publish the app back to my power app if I pick a different expense on my home screen now which is expense two and go to line items still shows me the expense for expense one the reason is because the gallery on the line items screen is connected to the entire line items table so this I will change to my expenses gallery. selected dot line items so we can see there are no line items for expense 2 but if I go to expense one I can see the line items if I create another one and save that's another expense that gets added for expense one whenever an expense is submitted by a user it should begin an approval process when an expense is created it should be associated with a cost center so here I'll create a new table I'll call it cost center so I have name for my cost center I'll add another column called approvers I can Define my cost centers let's say Microsoft and contoso and I can Define who my approvers are so resa is the approver for cost center Microsoft for Koso it's going to be Sarah and Resa now from my expenses table I would want to create a column again I'm creating a relationship I'll call this column related cost center and I'll make this a lookup column that looks up to the cost center table and if I go back to my canvas app now I will refresh my expenses table connection for my expenses form on the home screen I can go and add related cost center now if I was to let's say edit an existing item here I can also Define a cost center and the same solution is what I have gone ahead and built out further so I'll go ahead and create a new expense I can pick my cost center click submit my expense gets logged the status is new I need to submit it for approval so if I go to line items there are none so I'll create one so I'll create a food related expense once again I can upload a receipt I'll submit I have the ability to submit it for approval and when I submit the status here will change to pending and I'll get a notification that this expense request has been submitted for approval now this is a canvas power app we can also build a model driven power app and in this scenario I've built a very simple model driven power app and all I've done here is just connected expenses and cost centers to the site map the model driven app is designed with admins in mind I can see all the expenses and I can also see the information and the cost center table so if I want to add another cost center I can easily go ahead and do that right here in the model driven app and in the can app if the user Wass to create a new expense you can see that new cost center lights up right here you can have a canvas app and a model driven app complimenting each other now the expense that I created the status is spending I had picked Microsoft as the cost center so resa is the approver for that in my solution itself I also have a cloud flow this flow triggers whenever a row in the expenses table is modified and the status of the expense changes to pending now expense status is a choice column so if I explore the choices for expense status for pending this is the specific value that's exactly what I've leveraged here so my flow triggers when the status is pending and once that happens I go and get the details of the cost center because I need the approver information and then I begin an approval process I check the decision that the approval takes if it's approved I update the status of that specific expense to approved else I set it to reject it Resa being the appr R receives an approval action the approval action specifies the details of the expense request that has come in there's also a link which if the approver clicks will deep link the user directly to that canvas power app and highlight that specific item under approval can go to line items as the approver and the approver can directly take the approval decision in the email itself I'll approve it enter commands and submit my response now once that's done the user who created the expense will receive a notification that the expense has been approved yes's the name of the approver here are the commands and here's a link directly to that specific expense item and I can see how the status has changed to approved in can apps we also have a co-pilot control and for this control all I have done is I have connected a data source which is my expenses table as a user I can ask questions to co-pilot about my expenses for example how many expenses are in pending status and copilot has context of the data it understands the user context it will respect security here so it says there is one expense that is in pending status give me the total number of expenses and so and so forth so if I explore the solution I have a canvas app I have a model driven app as well I have my approval workflow my workflow uses the approvals connector data verse connector and an Outlook connector so these are those connection references can also create environment variables the site map for my model driven app I can also create security roles so I have three security roles that I have created the first one is expense user on the expenses table I have given it user level privileges meaning the user can only work with their own records so they can create an expense they can read expenses only related to themselves they can update that expense they can delete they can append this meaning relate this to another table or relate something to this table same setup for the line item table and for the cost center table they can only read all the data that's the or level privilege that I have granted I have an expense approval level security on the expense table notice I've given the approval read access on all the records but for creating updating deleting and all the other privileges it's set to use a level similar setup on the line it item table and for the role expense admin they have full access on the expense table and they have full access on the line items table now this solution I have created in a development environment next step I will publish all the customizations that I have made remember a developer type environment is predominantly meant for development purposes only you get full access to data verse you can create canvas apps mod driven apps flows leveraging premium features at no licensing cost if I was to share these apps with my users to run them they would need premium licenses now that I have my solution set up here we also have pipelines in Power Platform which is an in product experience for application life cycle management I have a pipeline that I set up which I have connected to this environment to allow my users to deploy this solution into Downstream environments I am currently in the development environment and I would like to deploy this to my next stage that my pipeline administrator has defined which is my test environment so I'll go ahead and say deploy here I'll click next it's creating connections for me in that Target environment I'll click next here it's asking me to define the environment variable I'll click next has the version of my solution all the details about my solution we also have ai generated deployment notes I can click deploy and this this will begin the process of deploying the solution the first thing that it will do is it will export the solution you can see how the pipeline moves ahead and now the deployment begins into my test environment Alm I can keep making modifications to my solution and my Dev environment that's where I have the unmanaged solution and once I'm ready to deploy it for testing I can keep pushing it to my test environment once I'm done with testing I can click deploy to start my deployment to the production environment it begins with establishing my connections can Define my environment variable here and once I click deploy the deployment process will begin in my production environment we have the solutions successfully deployed to my production environment if I head over to my production environment and go to Solutions under manage Solutions I will see my expense solution that got deployed via the pipeline experience now notice you cannot edit objects within a managed solution now all I have to do here is start assignment security roles to my users and share my apps I'll pick the expense reporting canvas app this I would want to share with the user Sarah I would like to Grant the expense user role and I will Click Share my model driven app on the other hand I would want to share this with my admins so my app the role that I've defined for this is expense admin so Resa already has it but let's say I want James also to get that role I'll assign James the expense admin role and Click Share so signed in as Resa as the administrator here is the expense reporting admin app can see that there are no expenses in the system there is no cost center configured so let me configure one and click save and close signing in as Sarah Sarah receives an email that the expense reporting app has been shared with her and she runs the app this is the power app in my production environment that is being run Sarah can start creating an expense the cost center is loading from my production environment data verse instance only so I've added an expense status is new Sarah needs to add line items she adds one line item for this expense and clicks submit for approval status changes to pending the expense request is submitted for approval the approver is Resa Resa has the admin role so in the model driven app when I look at expenses even though Sarah created this I can see all those details I can also see the related line items that Sarah has submitted for that specific expense and here is the expense approval email that comes out can approve or reject enter commands submit the response Sarah receives an email that her expense request has been approved it's the name of the approver the commands and here's a link that directly takes Sarah to that specific expense item status approved here are the approval commments if you enjoyed this video then do like comment and subscribe to my YouTube channel and thank you so much for watching