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 Apps / EditForm Default Mode,...
Power Apps
Answered

EditForm Default Mode, If(variable=value, view, edit). Not working

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

Hi,

 

So on my App On Start I have the property - 

 

If(Lower(User().Email) = "myemail@gmail.com",Set(varFormMode, "view"),Set(varFormMode,"edit"))

 

 

on my EditForm1 default mode i have - 

 

If(varFormMode="edit" ,FormMode.Edit,FormMode.View)

 

 

however - when i go to -

 

 

NewForm(EditForm1);Navigate(EditScreen1, ScreenTransition.None);

 

 

I can still edit! I shouldnt be able to edit this.

I have confirmed varFormMode does indeed = view with a label.

 

can anyone help

Categories:
I have the same question (0)
  • AARON_C Profile Picture
    2,235 Most Valuable Professional on at

    Hi @wonka1234,

     

    This is because you have < NewForm(EditForm1) > on your button when you navigate to your form screen.

     

    Please tick Accept as solution if the answer is useful.

    Thanks,

    @AARON_C 

  • wonka1234 Profile Picture
    920 Super User 2024 Season 1 on at

    @AARON_C so this should just be removed?

  • AARON_C Profile Picture
    2,235 Most Valuable Professional on at

    Hi @wonka1234,

     

    It depends on what you are trying to achieve.

     

    Because you are using the NewForm formula, I am assuming you want users with emails that do not match the set email in the onStart property to be able to create new records using the form. 

     

    Please tick Accept as solution if the answer is useful.

    Thanks,

    @AARON_C 

  • Verified answer
    SpongYe Profile Picture
    5,721 Super User 2026 Season 1 on at

    Hi @wonka1234 

     

    Please adjust as the code to make it work what you want.

    You can store a FormMode directly into a Set() function:

    If(
     Lower(User().Email) = "myemail@gmail.com",
     Set(varFormMode, FormMode.View),
     Set(varFormMode, FormMode.New)
    )

     

    On your EditForm1.DefaultMode you set the variable. Get rid of the If() statement

    varFormMode

     

    When you go to your form remove the NewForm because the Set() function already have the DefaultMode New:

    Navigate(EditScreen1, ScreenTransition.None);

     

    Hope this helps.


    -----------------------
    PowerYsa Power Platform Enthusiast [LinkedIn] | [Youtube]

    I love to share my knowledge and learn from others. If you find my posts helpful, please give them a thumbs up 👍 or mark them as a solution ✔️. You can also check out my [@PowerYSA] for some cool solutions and insights. Feel free to connect with me on any of the platforms above. Cheers! 🍻

  • wonka1234 Profile Picture
    920 Super User 2024 Season 1 on at

    @SpongYe ok let me test and get back to you.

  • SpongYe Profile Picture
    5,721 Super User 2026 Season 1 on at

    Any updates? @wonka1234 

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!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 846

#2
Valantis Profile Picture

Valantis 532

#3
Haque Profile Picture

Haque 410

Last 30 days Overall leaderboard