cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Regular Visitor

Calendar flow issue- updating or deleting older matching appointment

Hi everyone,

 

For some reason I'm really struggling to get this flow to behave as I'm expecting it to.

 

The scenario is we have a 3rd party program that will send appointments to a calendar. Now unfortunatley this program doesnt have the ability to send "updates", only "new" appointments. Therefore an updated appointment actually appears as an additional/new appointment.

 

So the flow I'm trying to create, should when a new appointment is created, search the calendar for exsisting entries with the same subject (the subject is unique to an appointment), and where there is a match, either delete, or at least update the older exsisting appointment, with the new details.

 

The closest I've got to this, worked in reverse and I've no idea why- ie the latest appointment was updated with the older appointment details.

 

Does anyone have any suggestions on where we're going wrong?

 

The flow created is:

 

Trigger: When a new event is created

Condition: When Subject is equal to *Subject

If yes: Delete event

If No: Create event

 

and with this I get the failure of "Id is malformed. clientRequestId: 671b6f65-bb38-41f3-9e05-139a2bd00bac serviceRequestId: a305d4f8-88ca-44a1-96bf-f8d76b56f994" and "ActionFailed. An action failed. No dependent actions succeeded."

 

I can find no way of effectively telling it to delete older event that matches the new event.

 

 

Thanks in advance,

Tom

 

1 REPLY 1
Highlighted
Community Support
Community Support

Re: Calendar flow issue- updating or deleting older matching appointment

Hi @Tom_1,

 

Could you please share a screenshot of your flow's configuration?

 

The error message told that the value that you filled within Id field of "Delete event" action is invalid. I think there is something wrong with the flow that you provided. 

 

I have made a test on my side and please take a try with the following workaround:

  • Add a "When a new event is created (V1)" trigger.
  • Add a "Get events (V1)" action, specify Calendar id.
  • Add a "Filter array" action, From set to output of "Get events (V1)" action, click "Edit in advanced mode", type the following formula:
@equals(item()?['Subject'], triggerBody()?['Subject'])
  • Add a Condition, click "Edit in advanced mode", type the following formula:
@equals(length(body('Filter_array')), 2)
  • Within "If/yes" branch of Condition, add a "Compose" action, Inputs set to following formula:
array(last(body('Filter_array')))

  Add a "Apply to each" action, input parameter set to output of "Compose" action. Within "Apply to each" action, add a "Delete event" action, specify Calendar id, Id field set to following formula:

item()?['Id']

Image reference:27.JPG

 

28.JPG

The flow works successfully as below:29.JPG

 

Best regards,

Kris

 

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

Tech Marathon

Maratón de Soluciones de Negocio Microsoft

Una semana de contenido con +100 sesiones educativas, consultorios, +10 workshops Premium, Hackaton, EXPO, Networking Hall y mucho más!

Top Solution Authors
Top Kudoed Authors
Users online (5,939)