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 / Number formatting in e...
Power Apps
Unanswered

Number formatting in edit forms and new forms

(1) ShareShare
ReportReport
Posted on by 119

Hello,

 

I have a source SharePoint list called "NCC List".

 

In my app I have a screen called "Screen_NCC" with:

1. gallery called "Gallery_Requests"

2. form called "Form"

 

The Form shows item selected from gallery, but "Gallery_Requests.Selected" did not work for some reason, so I have in item property of my form following formula: "LookUp('NCC List',ID=Gallery_Requests.Selected.ID)"

 

In my form, I need to set format of my Text Input field "DataCardValue37" so it shows "20.000" instead of "20000" - so I only need to separate thousands with dots during form editing.

 

In order to achieve this I did following:

1. DataCardValue37 - On Change property:

Set(FormattedNum,Text(Value(DataCardValue37.Text),"[$-en-US]#,###"));Reset(DataCardValue37)

 

2. DataCardValue37 - Default property: FormattedNum

 

3. Screen_NCC - On Visible property: 

If(Form.Mode=FormMode.New,Set(FormattedNum,""),Set(FormattedNum,DataCardValue37.Text))

 

What happens when I preview the app. The field is formatted immediately after I input the value and click in another field. That is perfect.

When I click on Save button (On select property shows: SubmitForm(Form)), it saves the entry.

But when I click on New button (On select property set as follows: ResetForm(Form); NewForm(Form)), the value that I entered previously remains in DataCardValue37. It is not empty, but I would like to have a clear form when clicking on New button.

 

Form default mode is view as it is meant to show item selected from gallery. However users have the option to edit item with Edit button (On select property: EditForm(Form)), from there reset form back to view mode with Reset button (On select property: ResetForm(Form)) or create a new item by clicking on New button (On select property set as follows: ResetForm(Form); NewForm(Form)) - and afterwards of course save changes by submitting form.

 

Could you please advise how to achieve that the field will be empty when opening the new form?

 

Thank you very much in advance.

Kind regards,

Hana

Categories:
  • AndrewR1 Profile Picture
    1,572 Moderator on at

    Hi @Eeyore2005 what I would try the following: 

     

    Formatting your Text number you can try this: 

     

    Substitute("20000","000","0.00")

     

    AndrewR1_0-1695979093038.png

     

    Set up a contextual variable to set if the form Default mode is New /Edit or View for instance i have an + icon that has this as its On Select: 

     

    UpdateContext({NewMode:!NewMode})

     

    And I have a pencil icon that has this as its On Select: 

     

    UpdateContext({EditMode:!EditMode})

     

    Then on my forms Default Mode Property I have: 

     

    If(NewMode,FormMode.New,If(EditMode,FormMode.Edit,FormMode.View))

     

    This will assess if the form is new edit or view form using the contextual variable we set before. 

    AndrewR1_0-1695978100267.png

    New Form

    AndrewR1_1-1695978129518.png

    Edit From

    AndrewR1_3-1695978335398.png

     

    Then on the Cancel icon I then set the corresponding Variable back to false to set the default mode back to view:

    AndrewR1_2-1695978196807.png

     

     

    And I have the submit on the save icon. 

    In your code I noticed your using Reset I dot think  this is needed as when you set the form mode to new this will always give you a blank form unless you have set the defaults of the data cards? 

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. Remember, you can accept more than one post as a solution. If the content was useful in other ways, please consider giving it Thumbs Up.


    Thanks
    Andrew

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 411 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 338

#3
WarrenBelz Profile Picture

WarrenBelz 256 Most Valuable Professional

Last 30 days Overall leaderboard