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

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Condition for 'contain...
Power Automate
Unanswered

Condition for 'contains' does not run when the value is null

(0) ShareShare
ReportReport
Posted on by

Hi

 

I'm making a room booking flow which looks at the calendar for the meeting room to see if there is already a booking at the time being requested. The room can be split into two so it needs to account for a booking existing in the calendar for 'GFMR 1', 'GFMR 2', or 'GFMR 1+2'.  GFMR stands for Ground Floor Meeting Room.

 

To do this I want it to check if there's an event containing 'GFMR' in the subject, if there isn't it creates an event with the subject 'GFMR 1', if there is it checks if the subject contains '2', if it doesn't it creates an event with the subject 'GFMR 2'.

 

I've got everything working except when there isn't a calendar event with 'GFMR' in the subject (which obviously isn't ideal). In this case the flow runs but never does the conditional step to check if it contains GFMR. I assumed that the conditional would still run and since no value does not contain 'GFMR' then it would have the outcome of 'No'. Instead it just doesn't run it. Can anyone help with this please?

screenshot.png

screenshot2.png

Categories:
I have the same question (0)
  • yashag2255 Profile Picture
    24,769 Super User 2024 Season 1 on at
    Re: Condition for 'contains' does not run when the value is null

    Hey @Anonymous 

     

    When checking for an attribute to check if there is some data, it depends on the datatype. 

    Example:

    1. If the datatype is array, you can use the length function to check if it is 0 and if it is 0 then it is empty. 

     

    For string, you can use the coalesce function. Something like this: 

    coalesce('string1', 'string2')

     

    In the place of string1, you can have the attribute from dynamic selector and in the place of string 2 have a test sample string. this function will return the first non null value among the two strings provided. 

     

    Hope this Helps!

    If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

  • v-alzhan-msft Profile Picture
    on at
    Re: Condition for 'contains' does not run when the value is null

    Hi @Anonymous ,

     

    Have your problem been solved?  If yes, please go ahead and mark the post as solved by clicking “Accept as Solution” so that this thread will be marked for other users to easily identify!

     

    Best Regards,

    Alice

     

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

  • Community Power Platform Member Profile Picture
    on at
    Re: Condition for 'contains' does not run when the value is null

    So I believe it is outputting an empty array

     

    Where should I be putting the length function? In the conditional?

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…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Tomac Profile Picture

Tomac 497 Moderator

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 477 Super User 2025 Season 2

#3
chiaraalina Profile Picture

chiaraalina 242

Last 30 days Overall leaderboard