cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
johnosakwe
Frequent Visitor

Automate create & Updating calendar event from Excel online ( once every time there is a modification or when it is recurrence

i am having issue with creating a flow to work clean, my case it works but it creates multiple event of the same constantly looping even though its a manual trigger, I just want it to create an event if it doesn't exist in the calendar or update if it does, not to create multiple events as the same time below is my structure.  If possible for it to trigger only if the file is modified that would be great

 

 

johnosakwe_0-1656145458977.png

 

 

johnosakwe_1-1656145458982.png

 

 

johnosakwe_2-1656145458986.png

 

 

 

 

below you can see the calendar example there are many but using one for testing 

 

johnosakwe_3-1656145458990.png

 

 

 

Test excel I am using

johnosakwe_4-1656145458993.png

 

 

1 ACCEPTED SOLUTION

Accepted Solutions

You are back to using multiple loops again, which you don't want.  Let me try to breakdown the logic for you

1) You retrieve the list of things from Excel

2) You get the list of Events from Outlook

3) You loop through each of the rows in Excel

        a) Filter the array retrieved from Outlook by comparing the Title to the Title of the Event

        b) Check to see if the filter returned one or more records.

                >0 - The Event exists.  loop through the array returned by the filter and update each one using the details from the current Excel Row. There should normally be only one

                 =0 - The Event doesn't Exist. Use the current excel row to create a new Event. 

 

other than adding the filter array and changing the condition etc, that is what you had in the post I last responded to.  This current post added a bunch of new loops that makes things worse.

 



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Join me at 365 and PWR EduCon in Chicago
EduCon Chicago 2022

View solution in original post

9 REPLIES 9
johnosakwe
Frequent Visitor

@Pstork1 @takolota @RobElliott 

 

What you guys think?

Pstork1
Dual Super User
Dual Super User

The problem is that you are looping through the Excel lines and the events.  Any time there is a mismatch its creating the new event.  Do your outer loop on the Excel Rows and then inside that do a filter array using the same condition.  If the result has a length() of 1 or more then update the event, otherwise create the event.  That should prevent duplicates.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Join me at 365 and PWR EduCon in Chicago
EduCon Chicago 2022

I think i get it but not sure how to put it in practice?

 

i should make a condition on "list rows present in a table" ? 

johnosakwe_0-1656275887252.png

what do you mean by outer loop

You mean this 

johnosakwe_1-1656276307563.png

 

Think i got it like this ?

johnosakwe_0-1656277347512.png

 

That's close.  But you need a filter array just above the condition.  Its the array that comes out of the filter that you are checking the length of.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Join me at 365 and PWR EduCon in Chicago
EduCon Chicago 2022

I see

 

below i am using the array its passing the information hope i am correct

 

johnosakwe_0-1656337715198.png


maybe this one, i am sort of getting it but the flow of it is confusing me

johnosakwe_1-1656339130884.pngjohnosakwe_2-1656339577920.png

 

You are back to using multiple loops again, which you don't want.  Let me try to breakdown the logic for you

1) You retrieve the list of things from Excel

2) You get the list of Events from Outlook

3) You loop through each of the rows in Excel

        a) Filter the array retrieved from Outlook by comparing the Title to the Title of the Event

        b) Check to see if the filter returned one or more records.

                >0 - The Event exists.  loop through the array returned by the filter and update each one using the details from the current Excel Row. There should normally be only one

                 =0 - The Event doesn't Exist. Use the current excel row to create a new Event. 

 

other than adding the filter array and changing the condition etc, that is what you had in the post I last responded to.  This current post added a bunch of new loops that makes things worse.

 



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Join me at 365 and PWR EduCon in Chicago
EduCon Chicago 2022

johnosakwe
Frequent Visitor

here is now the current one 

johnosakwe_2-1656406235703.png

when i run it i get the error below 

 

johnosakwe_0-1656405924905.png

johnosakwe_1-1656405963493.png

 

seems to break when it goes to the create event 

 

Realised my mistake it was the start date and end date, it was fom 30/06/2022 and the end date was 22/06/2022 corrected it now it run all of them

Helpful resources

Announcements
 WHAT’S NEXT AT MICROSOFT IGNITE 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Register for a Free Workshop.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

Users online (2,063)