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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / How to check if calend...
Power Automate
Unanswered

How to check if calendar item already exists?

(0) ShareShare
ReportReport
Posted on by 38

Hi all

 

So I have a flow that checks an email in a particular folder and if it is flagged.  If it is, it looks in the body of the email to get a start and end time and, based on that information (plus a bit more), it creates a calendar item.  Works good (many thanks to this community for guiding me in how I do this as I'm a complete newbie) but I'd really like to tweak it so that before it adds the calendar item, it first checks to see if an entry already exists for the same date/time and subject line.  If it exists, then don't add it again.  If it doesn't exist, then add it.  Just not sure how to go about this.

 

Here is my flow:

 

Fatal_Lordes_0-1677556860842.png this is my expression: 

trim(replace(split(split(outputs('Html_to_text')?['body'],'Date:')[1],'–')[0],'AEST',''))
Fatal_Lordes_1-1677556929577.png

I would really appreciate any help in how I would do this.

 

Thanks in advance....

 

Categories:
  • v-dezhili-msft Profile Picture
    Microsoft Employee on at

    Hi @Fatal_Lordes ,

     

    You can first use Get Events to filter out all the events of the current theme. Then use the filter array to filter events with the same date (need to have the same date format).

    vdezhilimsft_0-1677563231287.png

    vdezhilimsft_0-1677563590112.png

     

    Best Regards,

    Dezhi

     

  • Fatal_Lordes Profile Picture
    38 on at

    Thanks Dezhi.  I'll give this a whirl but can I please pick your brain for one other thing.  As said, the flow is working however it just failed because of the expression.  Presently, my expression to extract start/end date/time is like:

     

    trim(replace(split(split(outputs('Html_to_text')?['body'],'Date:')[1],'–')[0],'AEST',''))
     
    Which works fine with body like:
     
    Date:15/Mar/2023 00:00:00 AEST - 15/Mar/2023 06:00:00 AEST Duration:
     
    But they have just sent an email like this:
     
    Date:15/Mar/2023 00:00:00 AEDT - 15/Mar/2023 06:00:00 AEDT Duration:
     
    And the flow has failed obviously because it was looking for AEST not AEDT.
     
    How would I get the flow to look at the body and if it says "AEST Duration:", do this, but if it says "AEDT Duration:", do this?
     
    Typical as when I went to show someone the flow working, the email I picked to test and show them with caused the fail!  LOL, after testing the last 10+ all working fine!!  
  • Fatal_Lordes Profile Picture
    38 on at

    Actually, I might have worked it out as I'm thinking it would be conditions like you showed me above.  I'll give that a whirl, but if I'm barking up the wrong tree, please let me know.

  • Fatal_Lordes Profile Picture
    38 on at

    Hi @v-dezhili-msft 

     

    Sorry, been a while before I had a chance to come back to this.  

     

    I'm a little confused as to what should be in the red "Your Date" section you have done in your sample.  I see, based on your example, I need to add the Get events (v4) and the Filter Array with condition BEFORE the Create Event (v4) but I'm a little confused as I don't know the dates to look at until I've stripped out the body and converted to HTML and then performed expressions to get the start date and end date.  I'm assuming it is this data that would be what needs to be in the "Your Data" box? 

     

    Essentially, if I understand your process correct, the Get Events and Filter Array are saying go open up the nominated calendar and look at the date (which is taken from the stripped out HTML based on the expressions further on) and if there is an entry, don't do anything.  But if there is no entry, then add an entry?  Am I right in that?

     

    Thank you, again, for your help in this. 😸

     

    Fatal_Lordes_0-1678935004328.png

    Fatal_Lordes_1-1678935032410.png

    Fatal_Lordes_2-1678935065879.png

     

     

     

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Automate

#1
11manish Profile Picture

11manish 298 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 289

#3
Henil Profile Picture

Henil 125

Last 30 days Overall leaderboard