web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Ticket Duplications vi...
Power Automate
Suggested Answer

Ticket Duplications via Email Replies

(1) ShareShare
ReportReport
Posted on by 10
I am building a ticketing system with Power Automate, where someone can send an email to a shared mailbox and it creates a ticket in a SharePoint List and then sends them an email stating the ticket has been received. Unfortunately, if you reply to the shared mailbox message then it creates another ticket into the SharePoint List. I am trying to have the workflow read the Ticket ID in the Subject line of the 'When a new email arrives in a shared mailbox (V2)' action, I am using the ID that comes with SharePoint List since it is unique and auto increments, and if it sees the Ticket ID not to create a new item in the list. The purpose if for people to be able to reply and talk on that same ticket if necessary.
 
 
This is my flow so far, in my condition I tried to deconstruct this code: 
@greaterOrEquals(
  indexOf(
    coalesce(triggerOutputs()?['body/subject'], ''),
    concat('[Ticket ', string(variables('ID')), ']')
  ),
  0
)
 
and plug it in above. Afterwards it caused that error message above the flow. If anyone knows how to make this flow work above, I would greatly appreciate the help! I am also going to try and go to support for help on this, if I find the answer I will make sure to post on here.
Categories:
I have the same question (0)
  • Suggested answer
    trice602 Profile Picture
    15,589 Super User 2025 Season 2 on at
    Hi there!
     
    I use ticket id's like this and seem to work well; I have a handful of ticket Lists running with no issues:

    concat(formatDateTime(utcNow(),'ddMMyyyy'), '-', rand(100000,999999))
     
     
    That's going to give you a ticket number like 01112026-455642
     
     
    I like this format better than relying on the exact subject of an email.  Then your flow just scrapes the value out of the email subject or body and checks your list to see if the ticket# exists and terminate successfully immediate if it does.
     

    ------------------------------------------------

     

     

    ⭐ If this was helpful, please like and check the box below "Does this answer your question" to help others find this too!

     

     

    Always glad to help! 💯💯💯💯💯

     

    Tom

     

    Follow me on LinkedIn - Thomas Rice, PMP | LinkedIn

  • TW-08011754-0 Profile Picture
    10 on at
     
    What about using the ConversationID via the Send an HTTP Request? I am still experimenting with how to implement that solution as well since from what I have learned so far is that it's supposed to stay the same through a thread, but I have the same issue with not sure on how to put it in a conditional/ not sure how to put it together to not break my workflow.
  • TW-08011754-0 Profile Picture
    10 on at
     
    I am fairly new to Power Automate and I would love to test your solution that you sent however I'm not sure how to set it up
     
    I have a couple of questions:
     
    #1
    ^Is this the information that you gave me correctly inputted into the URI field?
     
    #2
    From what I have read, although it gives me something to point at to look for the information, it doesn't help me on implementing it. Unfortunately, since I am still pretty new to Power Automate I am having issues on correctly implementing this solution. Do you know to implement the information, or have any other information on the implementation process, above so I can use it in my condition statement to look for the reply/forward?
  • Suggested answer
    CU30121719-0 Profile Picture
    38 on at
     
    your approach will not work if different users create different emails with the same subject.
     
    Dear  ,
    you should check if the ingoing email is a reply or not. See email - OutLook Mail Rest API --> See if the message is a reply - Stack Overflow
  • Kalathiya Profile Picture
    719 on at
     
    Could you please share the error screenshot?

    Also, have you applied a Filter Array action to compare the Subject field? If yes, please share a screenshot of that as well.
     
    Additionally, it would be helpful if you could provide:
    #1. A screenshot of the run history
    #2. A screenshot of the Filter Array configuration showing what values you are comparing
     
    I need these details to confirm and better understand the issue.
     
    📩 Need more help? Mention @Kalathiya anytime!
    ✔️ Don’t forget to Accept as Solution if this guidance worked for you.
    💛 Your Like motivates me to keep helping.
  • TW-08011754-0 Profile Picture
    10 on at
    So after some trial and error, if the length function provided above is equal to 0 the ActionBranchingConditionNotSatisfied error orccurs.
  • TW-08011754-0 Profile Picture
    10 on at
    I tried that but it gave me a ActionBranchingConditionNotSatisfied error and skipped the False part of my condition statement automatically. Essentially it's blocking me from creating new tickets now.
     
    ****UPDATE**** 
     
    For some reason it won't let me edit my comment below so I'm putting it here. 
     
    The array is not picking any values up so the array can only ever be zero since it's empty. Although I liked the idea of the array, if I can't get it to accumulate any values then I won't be able to use it.
     
  • Kalathiya Profile Picture
    719 on at
    Hello @TW-08011754-0
     
    Approach 1:
    Once you’ve created the SharePoint item and sent the confirmation email, you already know the exact subject format being used for example subject line:
     
    New Ticket Generated #90090
     
    You can reuse that same subject logic in your flow for comparison.
     
     
    Add a Condition action to check the length of the matching items. If the length is greater than 0, terminate the flow. If the Condition is not satisfied (i.e., the length is 0), the flow will continue executing all subsequent actions, such as creating a new ticket in SharePoint and sending the confirmation email
     
     
     
    Approach 2: 
    Once you’ve created the SharePoint item and sent the confirmation email, update the SharePoint list with the subject line. Then, whenever a new email arrives, compare its subject with that column if a matching record is found, terminate the flow.
     
    If this solution fixed your issue, please mark it as the verified/accepted solution.
     
    📩 Need more help? Mention @Kalathiya anytime!
    ✔️ Don’t forget to Accept as Solution if this guidance worked for you.
    💛 Your Like motivates me to keep helping.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 245 Super User 2025 Season 2

#2
Expiscornovus Profile Picture

Expiscornovus 207 Most Valuable Professional

#3
trice602 Profile Picture

trice602 185 Super User 2025 Season 2

Last 30 days Overall leaderboard