cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
RussellGove
Level 8

Forms always open with Displaymode Edit

Hi ,

I generated a powerapp from a sharepoint list. I am trying to set the default date when a user creates a new item using this code I found on a message here:

If(
  EditForm1.Mode = FormMode.New,
  Today(),
  BrowseGallery1.Selected.VFLObservationDate
)

 

But when a user clicks on the '+' burtton on the top  of the Browse Screen, the form opens in Edit mode.  The onSelect code for the '+' burtton on the top  of the Browse Screen , out of the box is

 

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

 

But when  EditScreen1 opens , the form DisplayMode is Edit. 

How do I get the form DisplayMode  to be New

 

 

9 REPLIES 9
Super User
Super User

Re: Forms always open with Displaymode Edit

Hi @RussellGove

 

I think you might be confusing the Mode property with the DisplayMode property.

 

The DisplayMode property controls whether a control is enabled or disabled. It can take one of three values: Disabled, Edit, or View. The Edit setting enables a control. The View setting disables a control, but doesn't apply the grayed out visual style that the Disabled setting would.

 

In answer to your question, it isn't possible to set the DisplayMode to New because this isn't a valid setting.

RussellGove
Level 8

Re: Forms always open with Displaymode Edit

thanks for clarifying that. i'll check the formmode property.

Super User
Super User

Re: Forms always open with Displaymode Edit

Sure, you're welcome. Just to clarify, it's the Mode property of the form that you need to check (not the formmode property).

RussellGove
Level 8

Re: Forms always open with Displaymode Edit

yep, just tested it. That worked. thanks.

i've been displaying editform1.nod in a label to debug. it shows 0,1, or 2. 

Texr(Edeitform1.Mode)

 

is is there a way to display the 'string value' of an enum instead? (new, edit or display)

RussellGove
Level 8

Re: Forms always open with Displaymode Edit

btw, you seem to know powerapps well. can you recommend any learning resources?

Super User
Super User

Re: Forms always open with Displaymode Edit

@RussellGove

 

In this link , you will find all the helpful learning resources for PowerApps

 

https://powerapps.microsoft.com/en-us/blog/microsoft-powerapps-learning-resources/

 

There is also a training course on EDX –

 

https://www.edx.org/course/developing-business-applications-with-power-apps-and-microsoft-flow


Vivek Bavishi aka That API Guy
PowerApps and Flow MVP
Blog | Twitter | YouTube | Community Profile | GitHub



If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Super User
Super User

Re: Forms always open with Displaymode Edit

Hi @RussellGove

is is there a way to display the 'string value' of an enum instead? (new, edit or display)


I don't believe there's a built in way to display the string value of an enum. To dispaly the string value in a label, you might have to write conditional code like this, which I know isn't ideal.

Switch(Value(EditForm1.Mode),
       FormMode.Edit, "Edit",
       FormMode.New, "New",
       FormMode.View, "View"
)
btw, you seem to know powerapps well. can you recommend any learning resources?


Thanks for the compliment :-) In addition to the suggestions from @ThatAPIGuy , the template apps are a great way to learn. If you want to do some reading, you could also get my book, which contains some useful advice on how to build apps.

 

https://www.amazon.co.uk/gp/product/1484230027

RussellGove
Level 8

Re: Forms always open with Displaymode Edit

Thanks Timl, Just got the book. Its great!

Highlighted
Super User
Super User

Re: Forms always open with Displaymode Edit

Thanks @RussellGove :-)

 

Helpful resources

Announcements
firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

SecondImage

Follow PowerApps on Twitter

Stay Up-to-Date by following PowerApps on Twitter

Top Community Contributors for July 2019

Top Community Contributors for July 2019

Let's thank our top community contributors

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

FifthImage

Dynamics 365 and Power Platform April 2019 Release notes

Features releasing from April 2019 through September 2019!

Users Online
Currently online: 47 members 4,344 guests
Recent signins:
Please welcome our newest community members: