How to use Power Apps Cards for Dataverse notifications with Power Automate

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hi everyone it's Benitez here welcome back to my YouTube channel and today's WTF episode I'm going to share with you all how you can use powerapps cards for your notifications and date of births with power automate in 2021 I was a speaker for the Zero to Hero learning program that's run by Victor dantus I presented two sessions and in one of them I covered adaptive cards now the use case was to create a notification using power automate cloudflows whenever a new insurance claim was created in dataverse the Adaptive card would then be posted to a Microsoft teams Channel with details of the insurance claim it also included hyperlinks to view the insurance claim and the members insurance policy in the model driven app fast forward to today there's now perhaps cards in preview herbs cards is the next step up from adaptive cards and you can use them with para automate cloudflows if you want to learn more about powerapps cards I recommend watching a couple of videos the first one is from a Microsoft 365 Empower platform Community call with Matt McLaren and the second video is from a paracat live episode with Matt McLaren and Anthony youths in this WTF episode I'll share how to open model driven app forms and views from pairups cards I'll cover how to do the following in this WTF episode so stick along with me till the end I'll start with number one create a powerapps card navigate to make.parabs.com now initially you may think that you can create a card inside a solution by clicking on you select more select other and then select card however when you do this you end up with this which is incorrect keep in mind that this is the current experience when filming this WTF episode it could change in the future what you need to do is click on more in the left hand side menu Pane and you'll see cards you can then pin it and it will display permanently in the menu select cards this will show you your cards and this tab will display yours and your team's cards click on new card or create a card enter a name for your card in a description click create the powerapps card designer will now appear this should look familiar because it's similar to the powerapps studio user interface you have the tree view to see your screens and elements there's a drag and drop UI elements such as adding inputs and changing the layout there are some UI elements that aren't available compared to the ones available in pair app studio so keep that in mind you also have the same ability of adding data sources and lastly those variables which I'll cover shortly the first thing you want to do is add your data source as of when this WTF episode was filmed dataverse is the only data source available but the product team do plan on enabling other connectors in future updates since we're applying the same technique from the last WTF episode of using environment variables to build URLs for model driven apps I'm going to select the dataverse connector it will use my signed in user account for the connection next I'll add the environment variable definition table this is the table that contains the environment variables that have been created in a solution next I'll add the environment variables value table this is the table that contains the current value of an environment variable the second thing you want to do is create variables for the cloud flow these variables will become input values in the paraps cards action in the cloud flow I'll create several variables in the powerapps card I'm going to create variables that will be used on the interface of the card I'll refer to these as visible variables and the other variable I'll create is one that won't be used in the interface of the card but in the background I'll refer to this as an invisible variable for my visible variables they will be the values from The Columns of the newly created challenge I'll display the name of the challenge the description of the challenge and the owner of the challenge I'll create a variable for the name of the challenge in the name field I'll enter VAR challenge name and for the type drop down field I'll keep it as text this default value field implies what you want the value to be when the perhaps card is created it's optional and for my use case I want to leave it blank since it will be populated by the cloudflow next there's two options on whether the value of the variable is either reset each time the card is open or is left as is for my use case I'll be using the permanent option now the next couple of check boxes were confusing initially so I reached out to Matt McLaren and Anthony Hewitt's in the power as product team for the allow this variable to be customized checkbox this will turn the variable into an input for the card or the customization is required checkbox the value of the variable is required in other words it's mandatory to be set by the cloudflow parrot virtual agent bot or from the cards play page since I want my variables to be populated through the cloud flow I'll take these two check boxes now when you expand the additional variable information you'll see title and description these will be visible in cloudflows and in Bots for power virtual agents I'll show you shortly what this will look like in cloudflows I'll enter in a title and a description and now I'll click save we'll repeat this for the other two visible variables description and owner for my invisible variable the good of the challenge I'll repeat the same steps after the data source has been added and the variables have been created I can now build the powerapps card by default there will be a couple of controls already added to the screen of the card I'm going to update the name of the first text label now by the way I'm following Matt devaney's powerapps coding standards for canvas apps when naming the controls I highly recommend you check out this free resource when building your apps next I'll update the text to be the title of my card I'll update it to new challenge created and for a bit of fun I'll add the light bulb emoji and lastly I'll change the Style by making the text larger I'll next update the second text label by changing the name again followed by the text to be the name of the challenge and make it Bolder I'll now add a few more controls I'll select the text label and it will automatically be placed underneath the previous text label I'll update the name and for the text I'll reference the VAR challenge name variable as a reminder this is an input variable that will be populated from the cloud flow which I'll show you after I build the card I'll also update the spacing to none this will be the structure I apply to mimic key value pairs like in adaptive cards where I have one text label acting as a key and the other acting as a value I'll repeat the same steps for the two other visible variables of description and owner last two controls are two buttons I'll select the button control I'll name the button and for the title I'll enter view challenge I'll add another button control and name the button followed by entering a title of view active challenges this will be the same functionality that you saw in my previous WTF episode where a user will click on the hyperlink and it will open either the form or the view in the model driven the URL is going to be built within the property of the button using power effects environment variables will be referenced again using power effects I'll be using the same environment variables in a solution that you saw from the last WTF episode if you're familiar with canvas apps the launch function can be used to direct a user to a browser and load the URL which I showed you in the last episode however in powerapps cards if you try entering the launch function in your button control you'll come across as error message because it's currently not supported in Paris cards there's a list of power effects functions that are supported in the Microsoft learn documentation so what can we use since a launch function is not currently supported well we can switch the type over to open URL and then use powerfx to build the URLs one thing to be aware of is that the URL string must start with https colon and forward slashes to build the URLs I'll Be concatenating Strings again as seen from the last two episodes I'll use a string and tribulation rather than the concatenate function or the Ampersand operation I'll refer you again to Matt devaney's blog post where he explains how to use a string interpolation method in detail I'm going to apply a similar parafax formula from a canvas app that I showed you in the last episode I'll enter the dollar sign character followed by a double quote for string interpolation then I'll enter a curly brace to delineate the embedded expression and I'll enter the lookup function next I'll use logic in power effects to retrieve the current value from the dataverse environment URL environment variable now I'm going to pause here and let you know of one minor inconvenience I've come across you see how the power effects editor is showing as a single line at the moment and I can't use my mouse to expand the expression editor bar either I have to click on this drop down so what I do as a temporary workaround is build the expression in a label in parab studio and then copy and paste it back into the paraflex add editor I replace my placeholder text with my invisible variable for the challenge good similar to the power effects formula in the last episode there's the app name query parameter where the parameter value is referenced from the app name environment variable then there's a page type query parameter which is entity record next there's the etn query parameter where the parameter value is referenced from the challenges table logical name environment variable and lastly there's the ID query parameter where the parameter value is referenced from my invisible variable that I created in the perhaps card this will be an input value that will be populated in the cloud flow quick note here you'll see these yellow squiggly lines which is a delegation warning that you can safely ignore delegation and paraflex cards doesn't have the same support as delegation in canvas apps but because the expression is only performing a string comparison on a single field it's fine for the view active challenge button it's mostly the same with the the only difference of changing the page type to entity list and referencing The View ID environment variable along with providing the view type definition of 1039 for a system view as a reminder I did cover this in my last WTF episode so watch that episode if you haven't already done so now the cool thing about Paris cards is that you can preview your card in real time with the data which you can't do in adaptive cards this is through the play button which I'll click a new browser tab will open and it'll first be prompted to enter the values for the required input variables so I'm going to copy and paste the values from a challenge Row in my model driven app the card will then load and you can see the data I'll click on the first button and it will open the dataverse environment in a new browser Tab and open the model driven app with the forum for the challenge pretty cool right this send button will generate a link that you can copy and paste into a Microsoft teams message since this card will be populated by a power automate cloudflow we won't be using this feature now that the card has been created it can be added to a solution click on ADD existing then select the card under other the card will now be added to the solution next I'll show you how to pass values from a cloud flow to the input variables in the card in my cloudflow the trigger is when a new challenge is created in dataverse followed by an action that will retrieve the user details of the owner Associated to the challenge to call that powerapps card click on add new step and search for cards for power apps and select the connector you'll see a couple of actions and the one to select is create card instance in the drop down field select the card that you want to create you'll then see the input variables as input values for the action this is a title and the description of the input variables from the card I'll use Dynamic content from the trigger as the input values for the challenge name description and challenge ID for the owner I'll use Dynamic content from the previous action to reference the full name from the user table next click on add new step and search for postcard select the action postcard in a chat or channel in the post as drop down field select powerapps then select where you want to post the card to I'm posting to a channel and so I'll select the team and the channel lastly select the card input value as Dynamic content and that's it save the cloudflow and it's ready to be triggered okay now it's time for the demo I'm in my Innovation Challenge model driven app and I have a new challenge here which I'm going to save this will now create the challenge and dataverse and my power automate cloudflow will be triggered next let's head over to the cloudflow Run history and select the refresh button we can see that the cloudflow is now running and it has now succeeded let's head over to Microsoft teams and I'll go to the Microsoft teams channel that the card would have been posted to now initially you may not see your car load automatically but that's okay what you can do is click on the refresh hyperlink and this will now load your card we can see the challenge name description and owner from those input variables that were populated by the cloudflow now if I click on this first button this should load the new challenge record in my model driven app okay so let's check out the second button when I click on the second button this will now open up the active challenges system view in my model driven app and there you have it that is how you can use perhaps cards for your notifications and dataverse with power automate cloudflows I hope you learned something new don't forget to hit like And subscribe and I'll see you in the next WTF episode [Music]
Info
Channel: Elaiza Benitez
Views: 2,147
Rating: undefined out of 5
Keywords: power automate, dynamics 365, microsoft flow, dataverse, dynamics crm, automation, flow, power apps, microsoft powerapps, microsoft, microsoft automation, microsoft dynamics 365, microsoft crm dynamics 365, dynamics 365 tutorial, how to, microsoft flow tutorial, how to use power automate, power automate tutorial, power platform, microsoft power platform, microsoft dataverse, model-driven apps, modeldriven apps, environment variables, variables, Power Apps Cards, Adaptive Cards
Id: -YOx_JFp8OA
Channel Id: undefined
Length: 14min 41sec (881 seconds)
Published: Thu Jul 20 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.