Search code examples
sharepointsharepoint-onlinepower-automateadaptive-cards

Send all list item comments with no mention by email


Introduction

I am building an IT help desk ticketing system with Sharepoint Online and Power Automate.

I have one list called "Tickets" that stores every tickets submitted by users. Instead of exchanging information by email, I want users and the help desk to use the "Comments" section present in each list item.

Problem

Sharepoint Online does not natively have any feature to send an email to someone when a list item is commented with no mention. However I want the IT help desk to be notified whenever a comment is left on any ticket.

What I did so far

Power Automate not having any trigger for a posted comment, I decided to go for a recurrent flow that would

  • Trigger every 15 minutes,

    enter image description here

  • Get all the items in my "Tickets" list,

    enter image description here

  • For each item get all of its comments.

    enter image description here

  • For each item that has its last comment having no mention, send an email to the IT help desk with the desired information (Ticket ID, Ticket Name, User Name, User Email address, Last comment, Link to ticket).

    enter image description here

What I am expecting

I am currently sending an email per ticket that has its last comment with no mention, every 15 minutes. It is A LOT of emails.

What would be the best way to send only one email every 15 minutes with a recap of all the list items that have their last comment with no mention?

The best thing I could have is an email with a dynamic number of Adaptive cards that would look like this:

enter image description here


Solution

  • Adaptive cards not being authorized by company policies, the only workaround I found is:

    • Creating an HTML template that looks pretty much the same as an adaptive card,
    • Instead of sending an email for every comment with no mention, appending to a string variable this template filled with current comment information.
    • Sending only one email at the end of the flow with the string variable as the body of the email.