Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Building Power Apps
Answered

expected Enum Value. If popup variable = true, set variable to view, otherwise leave variable alone.

(0) ShareShare
ReportReport
Posted on by 909 Super User 2024 Season 1

Hi,

 

where am I going wrong here? GEtting expected Enum error here on DefaultMode of my editform1 -

 

If(conclu=true, Set(varFormMode, FormMode.View), varFormMode)

 

conclu is a popup, when its visible i want to make the rest of the form..not clickable i guess.

when its closed i want it to be varFormMode.

 

Thanks.

  • BCBuizer Profile Picture
    22,027 Super User 2025 Season 1 on at
    Re: expected Enum Value. If popup variable = true, set variable to view, otherwise leave variable alone.

    Hi @AdilAhmed4441 ,

     

    From a syntax perspective this all looks correct. Can you please share a screenshot of the situation where you get this error to see if that yields any further clues?

  • AdilAhmed4441 Profile Picture
    2 on at
    Getting this error expected Enum Value in this syntax DisplayMode = If(IsBlank(LookUp(MESC, ID = ThisRecord.ID)),DisplayMode.Edit,DisplayMode.View)

    Getting this error expected Enum Value in this syntax DisplayMode = If(IsBlank(LookUp(MESC, ID = ThisRecord.ID)),DisplayMode.Edit,DisplayMode.View) 

     

    How can I resolve it ?

  • Verified answer
    BCBuizer Profile Picture
    22,027 Super User 2025 Season 1 on at
    Re: expected Enum Value. If popup variable = true, set variable to view, otherwise leave variable alone.

    Hi @wonka1234 ,

     

    The DefaultMode is a declarative property and the Set function is a behavioural function. Using the two combined is causing the issue.

     

    Try setting the formula to:

    If(conclu, FormMode.View, varFormMode)

     

    You may notice I removed a part in the condition since it is redundant: conclu will already return a boolean. It's like saying: "If it's true, then it's true", instead of: "It's true".

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

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,668 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 66,004 Most Valuable Professional

Leaderboard