cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
HamidBee
Skilled Sharer
Skilled Sharer

What does FormatMode.New actually do?

I am reading about this function 'FormatMode.New'. In the MS documentation it reads the following:

 

"The form is populated with default values and the user can modify the values of the fields. Once complete, the user can add the record to the data source."

 

Does this mean that the form is populated with random, arbitrary values?. But why would someone want to do this?. Can someone please provide a further explanation with an example?. Thank you. 

 

1 ACCEPTED SOLUTION

Accepted Solutions
timl
Super User
Super User

Hi @HamidBee 

>> Does this mean that the form is populated with random, arbitrary values?.

This means that the form is populated with 'default' values. Default values are those that are defined in each form card here:

timl_1-1669464355918.png

 

>>Can someone please provide a further explanation with an example?

Here's a further example.  The syntax below illustrates that if the form mode is new, the aquisition date field defaults to 'Now()' (eg todays date). Otherwise, the form must be in edit or view mode, in which case, the value defaults to ThisItem.AquisitionDate (eg, the existing record value).

 

timl_0-1669464309879.png

 

Also, note the property name is FormMode.New, rather than FormatMode.New.

View solution in original post

2 REPLIES 2
Drrickryp
Super User
Super User

@HamidBee 

It means the form is populated with the Default values of the fields in your data source. Most of the time they are blank but not necessarily. There is nothing random about it. The description is of a typical form in new mode For a canvas app.

FYI, FormatMode.New is a property. The function to set that property is NewForm(Form1)

timl
Super User
Super User

Hi @HamidBee 

>> Does this mean that the form is populated with random, arbitrary values?.

This means that the form is populated with 'default' values. Default values are those that are defined in each form card here:

timl_1-1669464355918.png

 

>>Can someone please provide a further explanation with an example?

Here's a further example.  The syntax below illustrates that if the form mode is new, the aquisition date field defaults to 'Now()' (eg todays date). Otherwise, the form must be in edit or view mode, in which case, the value defaults to ThisItem.AquisitionDate (eg, the existing record value).

 

timl_0-1669464309879.png

 

Also, note the property name is FormMode.New, rather than FormatMode.New.

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (6,234)