Adding Dataverse Record Links in HTML Tables in Power Automate
I want to send a weekly summary of Open Opportunities & Activities to all the sales users to help them manage workload - nothing new or novel here (e.g. this post). I also needed to include a clickable link for each row in the emailed table. This included Opportunities, Activities and also the ‘Regarding’ record to the activity. So that the receiver of the email can quickly jump directly into the app.
In terms of creating HTML tables with CSS formatting in Power Automate - I always use this blog post (thanks Ryan!). Plus how to create a single dynamic URL for a dataverse record - I always use this blog post (thanks Linn!). This post will focus on creating dynamic URLs for different dataverse tables into a HTML table using Power Automate:
Opportunities
Activities (Task, Email, Appointment, SMS etc.)
Regarding (anything enabled for activities e.g. Contact, Account, Opportunity, Lead, User etc.)
Opportunities
Finito - your opportunity links are ready to go. Next up the troublesome ones - ‘Activities’ and ‘Regarding’.
Activities & Regarding
Step 2.1) and 2.2) are the same as step 1.1) and 1.2) above, but with Activities instead of Opportunities
Create and Send the Weekly Summary Email
Finally we need to check how much of a good two shoes our user really is - if they have no pending Opportunities or Activities - they don’t need an email. Combine the expressions from the two ‘Did you find any Opportunities/Activities’ steps into a condition.
empty(body('OppDueThisMonth')?['value'])
empty(body('OpenActivities')?['value'])
If they have any Activities and or Opportunities, we need to send them an email. Use the outputs from steps 1.5) and 2.6) where the links become clickable and the tables are ready to go to create the email. Then perform a bound action to send the email from dataverse.
Clickable links in HTML Table for Opportunities, Activities and Regarding
Congratulations for completing this gymnastics tutorial of HTML Tables and clickable links - I hope you survived! Questions comments etc. always welcome 😊