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 / Find out whether a for...
Power Apps
Unanswered

Find out whether a form is in New mode or Edit mode

(1) ShareShare
ReportReport
Posted on by

Hi,

I use the same form for new items and for editing existing items. Now I thought, that in my forms property "frmname.Mode" the current mode the form is in is set. But I recognized, that there are only the number representations of the form such as:

 

frmname.Mode.new 1

frmname.Mode.edit 0

frmname.Mode.view 2

 

That doesn't help me determine, in which mode the form actually is in. These are just the standard numbers.

 

Which property do I have to use instead?

 

 

 

 

Categories:
I have the same question (0)
  • VaidasG Profile Picture
    469 on at

    DefaultMode

  • VaidasG Profile Picture
    469 on at

    frmName.DisplayMode

  • andiart Profile Picture
    on at

    That gives me the three standard options "Edit", "Disabled" and "View" and in each there is just the word edit, view or disabled. The actual mode the form is in it doesn't reveal. Although DisplayMode is different from FormMode and that's what I need. There is also "New".

  • andiart Profile Picture
    on at

    That gives me the three standard options "Edit", "Disabled" and "View" and in each there is just the word edit, view or disabled. The actual mode the form is in it doesn't reveal. Although DisplayMode is different from FormMode and that's what I need. There is also "New".

  • andiart Profile Picture
    on at

    In the expressions there is no defaultMode option. This is only for to set the default mode in the properties of the form but not for use in code as it seems.

  • VaidasG Profile Picture
    469 on at

    could you expand, where is your challenge..? As you can condition your app logic by just checking current form mode... 

    if(frmName.DisplayMode = DisplayMode.Edit)...

  • andiart Profile Picture
    on at

    I don't need the DisplayMode but the mode.

     

    When I check against

     

    if(frmName.mode.Edit; ...)

     

    it always gives me 0, because 0 is the representation of the FormMode.Edit.

     

     

    if(frmName.Mode = FormMode.Edit;...)  though seems to work fine

  • Floscar Profile Picture
    8 on at

    This is very old but I came across it today. 

    You need to check against the enum value.

    so when checking to see if you are in edit mode

    If(frm_name.Mode =0, true, false)

  • ConradMoulin Profile Picture
    2 on at

    It's better to not use the value directly :

    If(
     frmname.DisplayMode = DisplayMode.Edit,
     true,
     false
    )
  • Floscar Profile Picture
    8 on at

    Can you elaborate as to why it’s better? I am still learning and would appreciate it. 

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 March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 530

#2
WarrenBelz Profile Picture

WarrenBelz 459 Most Valuable Professional

#3
Haque Profile Picture

Haque 314

Last 30 days Overall leaderboard