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

Outlook Calendar "Show As" falsely fails to detect free (0), gives error if use Lessorequals

I am creating a flow to automatically change a new event in my primary Calendar to Accept if the time slot is free. I have the "accept" part working but I can't get the condition to see if the time is free to return Yes when it's actually free.  According to the documentation I've found, Show As should do what I want and should be an integer, with Free = 0. However, when I do Show As - is equal to - 0, it doesn't recognize the time slot as free and thus the flow goes to the "no" side of the condition and fails to accept the event. I do manual "tests" so I can see the path it took and indeed it is clear that this condition is failing (following the "no" path).

I've checked the json to make sure the 0 is really an integer and not a string and of course I'm sure in my test case that the time slot is completely free, so I am stumped.

Here's the json in case that helps:

"expression": {
"equals": [
"@triggerOutputs()?['body/showAs']",
0
]
},

 

Further, when I try to change the operator from "is equal to" to "is less than or equal to" I get this error:

Unable to process template language expressions for action 'Condition' at line '1' and column '15462': 'The template language function 'lessOrEquals' expects two parameter of matching types. The function was invoked with values of type 'String' and 'Integer' that do not match.'.

 

Thanks for any help anyone can give!

1 ACCEPTED SOLUTION

Accepted Solutions
Expiscornovus
Super User
Super User

Hi @mbelvadi,

 

Just to double check, are you using the When a new event is created (v3) trigger action?

 

If so, the showAs property of that action only shows text like free, oof, etc. Can you try and use this expression instead?

 

equals(triggerOutputs()?['body/showAs'], 'free')

 

showas_free.png

View solution in original post

4 REPLIES 4
Expiscornovus
Super User
Super User

Hi @mbelvadi,

 

Just to double check, are you using the When a new event is created (v3) trigger action?

 

If so, the showAs property of that action only shows text like free, oof, etc. Can you try and use this expression instead?

 

equals(triggerOutputs()?['body/showAs'], 'free')

 

showas_free.png

mbelvadi
Regular Visitor

Ah, yes I am using V3. I'm new to Power Automate (literally this week) and didn't realize there could be changes that big between versions. I was following the info about ShowAs on https://docs.microsoft.com/en-us/connectors/office365/#calendareventclientwithactiontype

Is there a different page somewhere that more accurately documents the functions for V3?

Expiscornovus
Super User
Super User

Hi @mbelvadi,


No worries, you are looking in the right place 😀

 

In the same table it actually says that the ShowAs field will be a string (free) and not an integer (0).

 

Show as
ShowAs   string

Shows as free or busy

 

So, in your condition action just make sure you are looking for the string value free instead of the integer value 0.

[Revised post - apparently there was a long delay but it did actually make the change! Whew!  So I think I'm completely all set now. Thank you again VERY VERY much for your help!]

 

Trying that Compose code now and it does seem to at least get past that step to the next one with the correct answer whether free or not.  Thanks very much for that!  But now the final actual "respond" to accept the event is failing (it claims it succeeded but didn't actually change the appt in my calendar/to the recipient), and I didn't change that part of the code at all so I can't figure out how this could have affected that.  After your Compose, I Condition on the Organizer for particular senders, and if it matches that, then the Yes path is the Respond to an event invite.  Do you have any idea how changing the first Condition to the Compose could be affecting that last step?  

mbelvadi_0-1627925073491.png

 

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

New Ideas Forum MPA.jpg

A new place to submit your Ideas for Power Automate

Announcing a new way to share your feedback with the Power Automate Team.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

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

365 EduCon 768x460.png

Microsoft 365 EduCon

Join us for two optional days of workshops and a 3-day conference, you can choose from over 130 sessions in multiple tracks and 25 workshops.

Users online (4,563)