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 / IF-Conditions with mul...
Power Automate
Answered

IF-Conditions with multiple statements

(0) ShareShare
ReportReport
Posted on by 22

Hello everyone,

I set multiple variables for the IF-Conditions but it doesn't work.

 

# ### VAR
SET TageZweiAcht TO FormattedDateMonth = 'Februar'
SET TageDreiNull TO FormattedDateMonth = 'April' OR FormattedDateMonth = 'Juni' OR FormattedDateMonth = 'September' OR FormattedDateMonth = 'Oktober'
SET TageDreiEins TO FormattedDateMonth = 'Januar' OR FormattedDateMonth = 'März' OR FormattedDateMonth = 'Mai' OR FormattedDateMonth = 'Juli' OR FormattedDateMonth = 'August' OR FormattedDateMonth = 'Oktober' OR FormattedDateMonth = 'Dezember'


# ### DATE
DateTime.Local DateTimeFormat: DateTime.DateTimeFormat.DateOnly CurrentDateTime=> CurrentDateTime
Text.FromCustomDateTime DateTime: ResultedDate CustomFormat: $'''MMMM''' Result=> FormattedDateMonth

# ### IF-COONDITIONS
IF FormattedDateMonth = TageZweiAcht THEN
 Display.ShowMessage Message: FormattedDateMonth Icon: Display.Icon.None Buttons: Display.Buttons.OK DefaultButton: Display.DefaultButton.Button1 IsTopMost: False
END

IF FormattedDateMonth = TageDreiNull THEN
 Display.ShowMessage Message: FormattedDateMonth Icon: Display.Icon.None Buttons: Display.Buttons.OK DefaultButton: Display.DefaultButton.Button1 IsTopMost: False
END

IF FormattedDateMonth = TageDreiEins THEN
 Display.ShowMessage Message: FormattedDateMonth Icon: Display.Icon.None Buttons: Display.Buttons.OK DefaultButton: Display.DefaultButton.Button1 IsTopMost: False
END

 

Do I make a mistake at the variables?

How can I set multiple variables for IF 🤔

Categories:
I have the same question (0)
  • fraenK Profile Picture
    2,125 on at
  • Usr21 Profile Picture
    22 on at

    @fraenKthank you for your support! 👍

     

    It doesn't also work

     

    IF FormattedDateMonth = (TageDreiEins = 'Januar' OR TageDreiEins = 'März' OR TageDreiEins = 'Mai' OR TageDreiEins = 'Juli' OR TageDreiEins = 'August' OR TageDreiEins = 'Oktober' OR TageDreiEins = 'Dezember') THEN
     Display.ShowMessage Message: $'''%FormattedDateMonth%
    
    %TageDreiEins%''' Icon: Display.Icon.None Buttons: Display.Buttons.OK DefaultButton: Display.DefaultButton.Button1 IsTopMost: False
    END

     

     

    The variable "TageDreiEins" is false 🤔  

     

    Flow.png

  • Verified answer
    fraenK Profile Picture
    2,125 on at

    The correct syntax is

    IF (FormattedDateMonth = 'Januar' OR FormattedDateMonth = 'März') = True THEN

    But it would be easier to create a list with all the months and then use "contains" like

    IF %ListVariable% contains %FormattedDateMonth%

  • Usr21 Profile Picture
    22 on at

    @fraenK  best man! 😃

     

    Here's my solution with a list contained all the month.

    Maybe helps someone else

     

    SET MonatDreiEins TO $'''Januar, März, Mai, Juli, August, Oktober, Dezember'''
    SET MonatDreiNull TO $'''April, Juni, September, November'''
    SET MonatZweiAcht TO $'''Februar'''
    
    DateTime.Local DateTimeFormat: DateTime.DateTimeFormat.DateOnly CurrentDateTime=> CurrentDateTime
    DateTime.Add DateTime: CurrentDateTime TimeToAdd: 1 TimeUnit: DateTime.TimeUnit.Months ResultedDate=> ResultedDate
    
    Text.FromCustomDateTime DateTime: ResultedDate CustomFormat: $'''yyyy.MM''' Result=> FormattedDateTime
    Text.FromCustomDateTime DateTime: ResultedDate CustomFormat: $'''MMMM''' Result=> FormattedDateMonth
    
    IF Contains(MonatDreiEins, FormattedDateMonth, False) THEN
     Display.ShowMessage Title: $'''!!!''' Message: 31 Icon: Display.Icon.None Buttons: Display.Buttons.OK DefaultButton: Display.DefaultButton.Button1 IsTopMost: False
    ELSE IF MonatDreiNull = FormattedDateMonth THEN
     Display.ShowMessage Title: $'''!!!''' Message: 30 Icon: Display.Icon.None Buttons: Display.Buttons.OK DefaultButton: Display.DefaultButton.Button1 IsTopMost: False
    ELSE
     Display.ShowMessage Title: $'''!!!''' Message: 28 Icon: Display.Icon.None Buttons: Display.Buttons.OK DefaultButton: Display.DefaultButton.Button1 IsTopMost: False
    END

     

     

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 86 Super User 2026 Season 1

#2
Haque Profile Picture

Haque 55

#3
Ellis Karim Profile Picture

Ellis Karim 53 Super User 2026 Season 1

Last 30 days Overall leaderboard