Assigning task to related task

In my youtubo video, I demoed how you can create a Ticking and Tasking System using just SharePoint and PowerAutomate. You can view it here

I was asked how you could prevent a ticket being created if it was related to an already open ticket (Ie a reply or forward).

As we store the email subject in the Title, what we need to do, is check every new email to see if the title matches a title of an open ticket. (You may also want to check if the “EMAIL FROM” matches – but for this blog I will just demonstrate how to check the subject).

One limitation to this method is that there can be no more than 5,000 open tickets. This is because we are going to be searching all open tickets to see if the subject lines match, if we are searching on ore than 5,000 tickets then we will hit the List View Threshold.

To prevent this, we should ensure that the Status is index.

In MS FLOW, create a new flow which occurs when an Item is created:

Next we need to get the email subject (which is saved into the Title) and filter out “FW:” or “RE:” to get the original subject line.

To do this, I will set a variable and use the trim function:

trim(replace(replace(replace(replace(triggerOutputs()?['body/Title'],'FW:',''),'RE:',''), 'Re:', ''), 'Fw:', ''))

Now that we have the original subject, we can run a “GET ITEMS” flow, to see if it matches any existing items.

The filter check to see any items (that are not the current item) that have matching titles.

Note: It would be advisable to match email from as well

Status ne ‘Completed’ and Status ne 'Existing Task' and substringof('@{variables('title')}',Title) and Id ne @{triggerOutputs()?['body/ID']}

If there is exactly one result, continue:

Create a condition to check length is equal to 1:


If true, We will email the processor to alert them there is a reply.

Note: I suggest also attaching the email.eml file to the “parent task

And finally update the current item to be status = “Existing Task”

Now you can filter out the Exiting tasks from any view.

If the youtube video was helpful, please Like and Subscribe to my channel: