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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Error Message on If St...
Power Apps
Unanswered

Error Message on If Statement "Expected Operator"

(0) ShareShare
ReportReport
Posted on by 76

Hello again,

 

In my App there are 2 different states: When you load a datasource, or when you create a new. While selecting one of the states, i declared a variable with 1 or 2 --> ScreenSelection

 

My idea was, that when ScreenSelection is 1, you get to a new sheet, and when you have ScreenSelection 2, you get to a loaded sheet, with your entries.

 

However i want to combine both into 1 Screen with a If Statement and it shows me this error, while setting the defaults of a textinput:

 

Polarus_0-1663589293040.png

Why is there an error?

 

Pascal

 

Categories:
I have the same question (0)
  • Verified answer
    BCBuizer Profile Picture
    22,505 Super User 2025 Season 2 on at

    Hi @Polarus,

     

    You receive the error because you are trying to give multiple commands where this property will only take 1.

     

    Try using:

     

    Switch( ScreenSelection,
    	1, Last(OfflineOverviewCollection).Unternehmen,
    	2, LookUp(OverviewList, Dateiname=Gallery2.Selected.Dateiname).Bereich
    )

     

  • Akser Profile Picture
    1,546 Moderator on at

    Does this work?

     

    Switch(
    ScreenSelection,
    1,
    Your code for 1,
    2,
    Your code for 2
    )

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 Apps

#1
WarrenBelz Profile Picture

WarrenBelz 796 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 327 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard