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 Automate
Answered

Increment count

(0) ShareShare
ReportReport
Posted on by 66

Hi I am fairly new to this but wondered if someone could point me in the right direction please?

I want users to send emails to a generic email address.  Once recieved i want to increment a counter.  however the user could send an email which simply updates some information.  I would not want a unique number generated here.

 

Users would send me an email which contains a unique reference number say Ref:123x

I want to check 123x has not already been submitted.  If it has i don't want to increment my counter.  

 

Is there anyway to achieve this pleasE?

Categories:
I have the same question (0)
  • Verified answer
    Expiscornovus Profile Picture
    33,472 Most Valuable Professional on at

    Hi @Pcanimal,

     

    An approach could be to create a list in SharePoint with one item. You could store the current reference number in there and update it when needed. A flow could be trigger when there is no match for a reference number in the subject of a newly received e-mail. You could use a trigger condition expression with an indexOf function for that. 

     

    Below is an example of that approach.

     

    1. Create a list with one item.

     

    sharepointlistoneitem.png

     

    2. Create a flow with a when a new email arrives trigger action. In my example I used a shared mailbox. In the settings add a trigger condition expression like below:

     

     

    @equals(indexOf(triggerOutputs()?['body/subject'], 'Ref:'), -1)

     

     

     

    This expression checks if it can find the text 'Ref:' in the subject of the received e-mail. If it cannot find it (result would be -1) it would trigger the flow.

     

    triggercondition_sharedmailbox.png

     

    3. In the rest of the flow you could use the Get Item and Update Item action. In this example I am also sending an auto-reply with the reference number to the person e-mailing.

     

    This expression is used to convert the title value in the list from text to a number, increment it with one and format it back to you desired format (in this case D4).

     

     

    formatnumber(add(int(outputs('Get_item')?['body/Title']), 1), 'D4')

     

     

     

    sharedmailbox.png

  • Pcanimal Profile Picture
    66 on at

    sorry for the late reply!  Thank you very much i will try this next week and let you know how i get on

  • Pcanimal Profile Picture
    66 on at

    Thank you I finally got around to testing this and it worked perfectly.  I didn't understand the param 'd4'.  Than you

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…

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Automate

#1
trice602 Profile Picture

trice602 378 Super User 2025 Season 2

#2
David_MA Profile Picture

David_MA 273 Super User 2025 Season 2

#3
Expiscornovus Profile Picture

Expiscornovus 135 Most Valuable Professional

Last 30 days Overall leaderboard