⚙️How to use Actionable Messages in Outlook with Power Automate

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hi everyone in today's video I'm going to show you how to use actionable messages in Microsoft Outlook with power automate with power automate we are able to send an actionable message to Outlook but what is an actionable message if you are not familiar with that topic it's basically an extension of an Adaptive card along with the classic sub bin pattern there is another button which is able to trigger a URL and this open a door to many other scenarios imagine that you want to trigger from your actionable message you want to trigger for example a power automate flow another one or a logic app or just a measure function HTTP trigger for example so this cool scenario can be covered with an actionable message now I walk you through every step how to set up an actionable message in your organization and then send it through Microsoft Outlook using power automate let's get started here I am in teams I have here a normal SharePoint list embedded I recreated this list by using an existing template which is the asset manager the idea here is every time that a user add a new entry here a new item this trigger a power automate flow that send an actionable message in Outlook and every approver can decide if approval reject and then finally the asset is assigned to the to the requester that's it let me Demo immediately how it works this this process let's start to create a new item here I'm going just to add some field here Microsoft the model is a surface Studio let's say two acetype laptop color black and that's it for the first request this is fine I'm going to click on Save and now on top I have this request now let's see in Outlook if a new email comes down below I have a browser instance with a user which is in this case Adele events Adele events is one of the approver for this process this process is called a device cell service because theoretically everyone in the organization is able to request a new asset or a new device I will not focus on the front end and how the user can submit a new request I just used a normal list I want to focus on the entire process now Adele events as a proverb as got an email here this is a an actionable message now here on top I have some description new device surface Studio to laptop requested new device requested from the user Juliana DeLuca now here I have to take my decision I'm going to approve this request and then I have to this is our required field I have to provide a description here this is required in fact if I click on submit I can see validation up and running the tummy required field so let me type just something it's it's fine and then let's click on submit now the actionable message refresh and I have a message here thanks for submitting your request these are all users that are involved in this profit process so they are approvers that means that another approver that will open this email should see that someone else has already approved so this is the the wish scenario okay and this is exactly what I'm going to show you so I have here another user Diego siciliani which is included in this in this email and if I open right now the mailbox of Diego siciliani and if I click on the last email God I can see that now the Adaptive card refresh the actionable message refresh and I can see now another message the request number 16 has been approved by Adele events so this is pretty cool because the request has been already processed this is a very great scenario now let me go back in Microsoft teams and let me see the last request which is this one if I go on the right I can see that now the request is approved by Adele events so the actionable message as triggered another another Power automate flow that has changed the value in this SharePoint list item let's see the mobile experience here I am on my Android device I have Outlook open I just got this email new device surface laptop Studio requested I can then approve or reject directly from my smartphone I can type for example just uh okay and then submit now I'll show you some trick how you can build such such process so let's let's get started step by step here I am in make.powerautomate.com and I am connected with my service user I'm going to create now a new flow the first one that we are going to use for this process all I need to do is just an automated Cloud flow and then I can type the name request devices I'm going to use as a trigger when an item is created in SharePoint then let's click on create and now I can start to Target the site collection that I cannot see here I'm going to add manually the URL and it is this one okay then I'm going to Target the list which is device cell service and then I can move with the second action I'm going to use a compose action to create a next enabled message let me rename it properly compose action enable message now in input I'm going to pass the the Adaptive card that I created now let me show you this adaptive card in the designer in adaptivecard.io that's the website designer and then here in this page I can pass the Adaptive card that I used before now let me test the Adaptive card that I just used before so I'm going to choose also the the right host app which is Outlook actionable messages shorter short overview about this this actionable message this is just a textbook a text block and I have here other additional text box now I want to highlight the input Choice set here that I place it I have three different choices here approve ratchet more info needed this is the style is expanded you can change the style as as you want and then it's very important to Define an ID so I can take the value selected from the user later initially visible and then there is this other input text for the comments I have the finally here as well on ID comments very important so I'm able to to take the value uh written down from the user in this field and then I added also required and yeah defined a field required an error message just a generic message so that's it and the last the last one is the action set it is an action.http and this is exactly the particularity and the capability of an actionable message you are able to trigger another service which could be as I mentioned at the beginning of this video could be a logic app could be a power automate Vlog could be an Azure function HTTP trigger whatever service in the cloud now here I defined the title which is title submit the style is default the method is post here I have the URL we are going to replace this later I show you what what URL you have to place there and then the body this is very important what I have here is this Json so that means that when a user click on the button submit call this URL and make a post sending this Json sending this option then options dot value this property Define exactly the value or the option selected by the user if approved project or more info needed comments comments.value with the curly brackets double curly brackets on the left and on the right we are able to take the current value of the of the comments Define it from the user and then there is another parameter this is a hidden parameter let's call it in this way it's not a text box in this adaptive card it's just a value that we send with the post request and this contain the ID of the list item in their SharePoint list this is very important so we can make some validation later then as a HTTP headers what we have here is an authorization you in the value you have to leave this leave it blank and then content type application.json because we are going to send a Json don't forget this HTTP headers otherwise you will get a Nexus denied error so that's it this is the Adaptive card it's ready to go and let me go back now to the power automate flow I already copied this but this is not finished yet there are something that we have to change first of all we have to change the url because this is not the the URL that we are going to call it I'm going to use another Power automate flow for this for this demo but feel free to use a logic app or or an Azure function HTTP trigger it's up to you of course with viral automate you have some limitation in terms of licenses because a power automate flow HTTP trigger requires a premium license and if you don't have you can opt for a logic app for example which is cheaper then I have the header defined here exactly what we have seen before the the body in the body we are going to send this jasm this is the ID of the list item just added here again we have to remove this this URL now let me highlight a little bit this part this is very very very important this is how to evoke action this is where the magic happens so basically as I mentioned it when an approver process a request another approver involved in this kind of process should see the refreshed and updated step in the process this avoid Mistakes by typing or making some selection on an Adaptive card which is already made from another user so in this case a second a third or an alternative approver should see an updated situation and how we can do that there is this property called Auto invoke action this call the URL that you define here passing you are able to pass a Jason for example and with that steps we are able every time that another approver opened the email we are able to invoke our process our service and in that specific step we are able to check the current status of the request so we can send back an updated actor enable message to the second approver by informing him that the request has been already approved that's it so now another important property that I want to highlight here is the originator so I'm going to delete this one because I use this for my my demo and we are going to I'm going to show you how you can create a new originator which is essential if you want to Target Outlook because the originator validate the URL that you are going to use this is for security reason we are able to say that in exchange we want to call a specific URL from Outlook using Edge enabled message okay so that's it from an Adaptive card and an actionable message perspective now I'm going to create another step another action this time I'm going to add another compose action we have to wrap up the actionable message in a script tag and in the input I'm going to pass the this thing so in this tag I'm going to add the outputs of the previous action compose actionable message now that I embedded this actionable message in this script tag I can set it through Outlook so I'm going to call Outlook Chris is 5 and then I'm going to type send send an email version 2. and here we have to Target the approvers we can also Target a Microsoft 365 group for example now let me Define some approver I'm going to add a delevance Diego siciliani Nestor Wilkie that's it that's enough here we can define a subject new device new device requested and now here another thing very important you don't need to to add the outputs as is in the in this body but you have to jump in the code View mode so I'm going to delete these elements and now here I'm going to to trigger the dynamic value panel and I'm able now to add the outputs coming from wrap up actionable message don't forget that thing otherwise you are going to send this adaptive card as a plain text and will not work now in this way I am sure that I'm sending to the three follower to the three approvers this action enable message so I can save for the moment this thing but it's not completed because in the actionable in the compose actionable message action we have to refresh and update the URL the right URL that we are going to call and the originator now before to create the URL and the originator I have to create another another Power automate flow let's go in my flow let me click on new flow and then I'm going to click on instant Cloud flow let me Define a name here process device request at the very bottom you can find when an HTTP request is received I'm going to use this trigger let me click on the button create and now this power automate flow is ready to go remember that this require a premium license for that specific trigger so if you don't have a previewable license maybe you should opt for a logic app which is cheaper or a natural function or another service in the cloud that could be triggered using a URL now just down below I'm going to uh to add a just a simple action in order to save this power automate flow and to take the URL now let me add a compose action and here I'm going to decode the authorization bar in the header this because for security reason every request coming from the actionable message will contain a better token in the header in this way we are we can check and we can be sure that the request is coming from uh from an actionable message from Outlook so let me type now in a name for this step the code authorization Bearer header and in the inputs I'm going to add a function that I already copied before and this is the the function that I'm going to use basically I'm going to split token the first part of the token and I show you the parameter and properties that contain this token okay the first part is done and this means that we are able to save this power automate flow take the URL and fill out the missing parameter in the previous power ultimate flow let me copy now the the URL and I can go back on my flows in request devices I can now add this URL going in the compose actionable message there is the URL property and I can now paste it the URL so we are going to invoke and call this other power automate flow HTTP trigger voila we are ready the last thing to complete this first Power automate flow is the originator now as I mentioned it the originator it's a greedy that will give you the chance to use properly in your Microsoft 365 environment a service now how we can get the originator there is a site it is called outlook.office.com connectors um slash publish let me go on this page this is the dashboard in Outlook where every user can request for an originator in specifying a URL so by doing that we can use and work with actionable messages in Outlook now I'm going to create another provider I'm going to define a friendly name this is the originator that I can already take let me go back in the previous power automate flow the first one I'm going to pass there the originator but we have two requests now we have to perform this request the sender email address for which action enabled messages will originate the sender as I mentioned it is the my service user that I'm using here so I can go back in this dashboard and now I can add this user that will send the email let me pass the the service user email the target URL which is absolutely important it is the previous URL that I copied coming from the second power automate flow the HTTP trigger to be persist then you can add another action URL if you want but we have just one and finally we have a public key if you want to add more security to this to this process you can Define even a logo and then down below there is the scope of submission this is very important if you are developing some some process and you want to just build up a proof of concept you can opt for the test user and this will Auto approve immediately the request and you will be able to play with this actionable message with a specific email address but if you are ready to roll out this service in your organization you have to Target then organization moreover if you have if you are an isv an independent software vendor and you are selling your power automate flow or your logic app or your process to other companies then you can opt for Global so in this way this URL and this originator can be used in every tenant now I'm rolling out this service in my company then I'm going to Target organization finally the last step to do is to define the an email address that we want to notify with this request okay I added the admin I can add some comment if I want I'm going to leave it blank accept the terms and condition and then I can click on save with this request once is approved I can start to play with the action enable message now let me go on Outlook as Giuliano let's let's see this this request coming I have a new request I can click on a view submission and this opens this the dashboard that we have seen before but the URL is different it's always outlook.office connectors om but I have slash admin this is the view for a nutmin I can see the current status it's pending approval I can type something here okay and then I can click on approve this request is approved request devices can be used in in my power automate flow I am back in make.powerautomate.com with a service user I added the originator which is now approved and it's trusted we can use it with this URL now let me go back and for for the first Power automate flow we have done I'm going right now to to work with the second flow which is process device request let me edit this power automate flow and it's time now to add more things and actions in this flow I'm going to click on news next step and then I'm going to add another compose action that operation and it is another compose action in the input clicking on ADD expression I'm going to pass this expression and as you can see here I'm going to read the bearer token coming from there from the request from the post request and I'm going to to take the second part of the token okay let me click on Save now that I have defined this to think let me name properly this this thing now this power automate flow is saved the code authorization better payload voila now I'm going to save this and before to build up additional steps I want to show you the this token how it looks like and what you have to do with this token this is very important because as I mentioned for security reason this token it gives you the chance to make some some tests if the request is coming internally from Microsoft 365 or outside so it's a nice way to be sure that the request is trusted and is safe here I am in another Power automate flow let me go in my flows I have here another flow this is just to show you how it works this power this authorization token now opening here the HTTP request action and clicking on show rows there is here the action authorization which contain the better token now highlighted this token and here I have another tab open this token is the Json web token that you get and if you go on this website JWT dot IO you are able to encode your token so I can for example pasta here my token and in this token our contained three different parts we can define it so we have the first part this thing which is the header of the authorization and it contains this properties in the second part which is the the part that I'm going to decode and reuse later it can say it contains several other information we have the app ID so the application that is performing the the request then we have the sender which is the service user that I use it to build up the power out midflow and to send the actionable message and finally we have very important another one which is sub this is the the user that has opened the actionable message that has just opened the actionable method or maybe us click it on the button submit so with that information you are able then to process the request and to store the data or update the data in SharePoint in dataverse whatever whatever you want now that I Define at the the meaning of this token we are able to go back in a power automate and to continue to build up our our flow what I need what I really need is the payload of my pair token because this contain the user that has opened the actionable message or the user that has clicked on the button submit now let's go back let's click on this tab here I have the token that I was building let's go with the another action I'm going now to parse the Json from the previous step let me rename it authorization barrier payload I'm going to take the output the previous step and in the schema I'm going to place this Json schema so I have the sub here which is the user that has submitted the actionable message and I have several other information Next Step for the validation I'm going to add a condition here and here I'm going to use an expression which is this one let me close with this expression I'm going to check comments if this is is empty so then using the expression panel and typing through so if comments is empty so then we have an issue of validation then let's add another group I can then use the the expression trigger body option and this is not equal to Auto in book we are in the yes case and then here I'm going to provide a response response which is in premium as well this one and I'm going to return a different status HTTP status the status will be 406 which is a validation error and in the header very important I have to Define card action status so that the status will be changed and updated and here we have to provide the validation however this is the message that we are going to send back if we are in this case now let's move in the if no case here I have to handle two different cases the auto invoke so when a user open an actionable message and then when the approver approve or reject the request so first of all I need to use the connector short point because I have to get the item so let me select SharePoint and then get item this one site address that's the URL okay now I can select the list it should shows up here we go device cell service the Heidi I already know this cam comes from the from the request this comes in the in the post request Json I have to add this expression I'm going to convert this string in an INT because this is a column which contain a numeric value and I'm going to read the body of the request with this this property AC underscore ID this is defined as the ID of the text Block in the actionable message in the Adaptive card okay I added this thing as well and now I'm going to add another control which is in this case as which control because here I want to check the output if this is a request that has been approved rejected or it's if this is an autoim book let me add this other expression trigger body open parenthesis closes parenthesis question mark square bracket single quote option and voila now I have the the option here and here I can add if we are in the case of Auto invoke or let me add another one or approve now let's go with auto invoke you can even add another one if you want to differentiate the behavior we have for example reject so you can do another thing here let's say data is in the auto invoke we have to send back and refresh the actual enable message informing the user that probably the request has been already approved let's add another condition let me rename this condition if the request status is requested so here I can take coming from the get item the request let me search so we are faster request status value if this is not equal to requested it means that has been approved or rejected then we can update and refresh the action enabled message let me add another action I have to prepare another actionable message that will replace the the previous one for that case I'm going to use another compose action compose I'm going to rename it not command it's renew refresh actually enable message for auto invoke and luckily I have already prepared the Adaptive car to send back this is just a normal adaptive card with this text block the request number the ID coming from the from the request that's being approved by here let's add the decision taken from the user which is contained in the decision field in short Point decision display name it's perfect has been approved by and then we have the user that has approved this in the last step of this if yes Branch I am going then to send a response and this will refresh the Adaptive card in the body of the email 200 is the status is the card status this is the response for auto invoke in the header absolutely important you have to provide this property car update in body and then here true in this way in Outlook the service will know that the actionable message must be updated and then here in the body I'm going to provide the output coming from the refresh actionable message for Auto in book now this part is completed to not to bring an end this power automate flow we have to update the list item and we have to send back to the approver refresh reduction label message and we have done let's go now in the approve case and here let's start to add a compose because I have to update the Adaptive card in case the approver approves the the request let me paste it here this adaptive card I'm going to rename this refresh actionable message for proof then here in the text of the text block I'm going to add a variable and in this case is it's the name of the approver so the person that is interacting with the actionable message and now we have to send this actionable message now let me search for the response action I have to return something um down below I have the response which is in premium so these are all things that you have to consider response update adaptive card for Approved 200 is the status that I want to return again the property in the header card update in body absolutely important to refresh the actionable message and now here I can select the refresh account enable message for approve the outputs looks good here now in The Last Action I'm going to update the list item let me type update I have short Point connector here and let me type again on update item here we go I have to select again the website I added the website list device cell service to be consistent I will use the same property in the expression trigger body AC underscore ID that comes from the request from the post request the title I can reuse the same coming from the get item this is required I have to specify just required field what happens here basically the request is approved and in the decision claims I have to add the person who has decided this is very easy in the expression I can let's use the dynamic value here I have just to type sub and this is this comes from the birth token and voila I made for the approval it's done and going to do the same for reject now to speed up things I just cloned the three steps that we have seen before adding and removing the text and changing the text here because it's specific for this use case here we have a rejection and the status will be rejected and this is the power automate flow ready to go I can save and now I can enjoy this process all right we have seen in this tutorial how to use actionable messages in Microsoft Outlook if you enjoyed this video as always please consider to subscribe like comment I hope to see you next time
Info
Channel: Giuliano De Luca
Views: 12,396
Rating: undefined out of 5
Keywords: giuliano de luca, adaptive cards, power automate, power platform, office 365, actionable messages, microsoft 365, actionable messages outlook, microsoft flow, power apps, power automate desktop, microsoft power automate, power automate desktop outlook, adaptive cards outlook power automate, adaptive cards outlook flow, microsoft power automate tutorial, power automate tutorials, power automate tutorial, power automate desktop automation, how to use microsoft power automate
Id: DCihYRK8w9Q
Channel Id: undefined
Length: 38min 34sec (2314 seconds)
Published: Thu Nov 03 2022
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.