You’ll be able to examine our findings in Alex’s publish beneath.
https://www.itaintboring.com/powerstorm/adaptive-cards-findings-powerstorm-session-summary/
Let’s begin with some background. The tables and information on this publish have been constructed just for the aim of this publish. In our case we have now a transaction document that has sure details about the main points of a selected buy or acquisition. After the document is created, it’s submitted for a number of ranges of approval by an analyst, affiliate, director, authorized and at last after all of the approvals have been accomplished it may be accomplished or revealed. The screenshot beneath exhibits a transaction document with among the information populated.
Because the person requests for Approvals, a move is executed, and based mostly on the Motion Sort (Submission, Approval or Rejection), the staff that that is despatched to (Analyst Staff, Affiliate Staff, Director Staff or Authorized Staff), the move executes and processes the request. The display screen beneath exhibits the totally different levels that this approval goes by means of.
Now let’s briefly take a look at the move that we created. For testing functions, I created a move with a handbook set off that accepts three enter parameters the Motion Sort, the Subsequent Stage (or Standing) and the Transaction Distinctive Identifier. For the precise implementation I’ve a transition entity that specifies what motion may be carried out on a selected stage, and what the next levels may be. For instance if I’m in Affiliate Assessment, the 2 accessible kinds of Actions are Approve and Reject. If I approve, the next stage will probably be Director Assessment, and if I reject, the next standing will transfer again to Analyst Assessment.
The move begins by querying just a few totally different entities and getting some parameters from our Dataverse occasion. We begin by querying the System Consumer entity and getting the System Consumer Id, after which querying the String Maps and getting the Motion Sort Code (as proven within the screenshot beneath)
The Expression for the System Consumer is: first(outputs(‘List_Systemuser_records’)?[‘body/value’])?[‘systemuserid’]
The Expression for the String Map is:
first(physique(‘List_action_type_records’)?[‘value’])?[‘attributevalue’]
Subsequent, we have to get the stage id of the subsequent stage, and the distinctive identifier of the final transaction stage document which must be up to date with the motion and the stage.
The Expression for the System Consumer is: first(outputs(‘List_stage_records’)?[‘body/value’])?[‘bas_stageid’]
The Expression for the String Map is:
first(outputs(‘List_unfinished_stage_records’)?[‘body/value’])?[‘bas_transactionstageid’]
Now that we have now all the knowledge we will begin updating the info in our present transaction levels and transaction tables.
The very first thing that will probably be up to date is the Transaction stage document that’s In Progress. This will probably be up to date with the Motion Sort, the ending stage, the Consumer that accomplished the motion, and the completion date. The screenshot beneath exhibits that replace.
Subsequent, we have to create a brand new transaction stage document. It will comprise the stage as the start stage of this document and the proprietor of the brand new document. The proprietor will probably be accessible within the Stage Transitions desk which comprises the title of the proudly owning staff.
Lastly we’ll replace the transaction entity with the present stage in order that the customers navigating to the document can see the present standing, in addition to this enables us to handle safety on the document by reassigning the document to a special staff that may have editable entry.
Now that all the updates have been accomplished, I have to get some information from the Transaction document, and associated information to have the ability to populate within the e-mail. We are going to get all information from the transaction desk, after which solely the Account Title from Accounts, the Full Title from Contacts and the Full Title from Consumer for the title of the approver.
Earlier than we take a look at the e-mail, let’s take at just a few hyperlinks, that permit us to design the adaptive card.
The Adaptive Card Designer lets you design playing cards, not just for Outlook but in addition for different internet hosting apps, comparable to Bot Framework, Microsoft Groups, Cortana and different Home windows purposes. You’ll be able to copy the payload of your card to move from right here as nicely.
https://adaptivecards.io/designer/
The Actionable Message Designer is a instrument that lets you customise the Adaptive Card that will probably be used for Outlook. You’ll be able to design it utilizing a visible designer, after which use the JSON Payload to repeat into your move.
https://amdesigner.azurewebsites.net/
Each designers present a listing of predefined samples which you should utilize when designing your Adaptive Card. In our specific case, we used the Expense Approval pattern card from the Actionable Message Designer.
Now let’s get again to our move, and see the implementation of the adaptive card.
We enter the To and Topic within the E mail Message, and earlier than we paste the physique of the e-mail, we have now to embed it into an Html web page. The next is the required content material:
The content material of the adaptive card payload is lengthy, so I’ll present this in an animated gif beneath. It is going to comprise details about the transaction, the purchasers and the standing historical past of the transaction.
After the move has been accomplished, the beneath e-mail containing the adaptive card will probably be acquired.
Now that we have now created the adaptive card, there are some things that we’d like to bear in mind. There are particular safety necessities that may mean you can ship an adaptive card to any person. If you’re solely doing this inside your group, this could be somewhat simpler, but when it’s international, there are further necessities.
https://docs.microsoft.com/en-us/outlook/actionable-messages/security-requirements
You will want to register an originator to your actionable messages and add that to the script of your actionable card. Publishing is completed by including an account that may have entry to ship actionable playing cards:
https://outlook.office.com/connectors/oam/publish
The complete resolution may be present in my github repository, and hopefully I can create a video of this someday quickly.