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 / Patch is dropping trai...
Power Apps
Unanswered

Patch is dropping trailing zeroes in a Collection

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

In my Power App I have a section where users can add multiple line items and the Save Button Patches the data for each line.

When a user enters say 125.20 and then clicks the Save button, the Field value drops to 125.2

This causes an issue as I have another field where users enter the Total amount of all items they are submitting.
So in the "Total Amount" they enter 125.20, but the Field value in the table after patch is now 125.2 and the two values don't match.

ETA Collection information for the OnStart of my App:
ClearCollect(AcctInfo, {CompanyCode:"", GenLedAcct:"", ProCenter:"", CostCenter:"", WBS:"", IntOrder:"", Amount:"", TaxAllCode:"", TaxJurCode:"", Desc:"", TradPart:"", ShowSaveButtons: true })

 

Tried using Amount: 0 but received errors in the clearcollect statement.

 

My Patch command is: 
Patch(AcctInfo,ThisItem,{CompanyCode:CompanyCodeVal.Selected.Result,GenLedAcct:GenLedAcctVal.Text,ProCenter:ProCenterVal.Text,CostCenter:CostCenterVal.Text,WBS:WBSVal.Text,IntOrder:IntOrderVal.Text,Amount:Value(AmountVal.Text),TaxAllCode:TaxAllCodeVal.Selected.Result,TaxJurCode:TaxJurCodeVal.Text,Desc:DescVal.Text,TradPart:TradPartVal.Text,ShowSaveButtons: false });

Where "AmountVal" is a Text Input field - Format = TextFormat.Number

Categories:
I have the same question (0)
  • eka24 Profile Picture
    20,925 on at

    What is your datasource, excel?

    ------------

    If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    It is Patching the data to a secondary SharePoint list.
    The column there is "Currency".
    It only drops trailing zeroes after a decimal point. if they enter .35 it works.. if they enter 123,123 everything is good..

    But enter 123.30 and get 123.3

    I've tried setting it to Decimal point zero and Decimal point 2 .. both result in the same dropping of the trailing zero. 

  • eka24 Profile Picture
    20,925 on at

    Consider using a Single line of text Column

    ------------

    If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    @eka24  Thanks.. I tried Number field, Text field and currency with no change..

    But I forgot to mention something that might be where the issue is.

     

    My patch command is updating a Collection in the form, not the actual SharePoint list. My Submit button then writes the collection to the 2nd list.

    The part of the "OnStart" for my app that builds the Collection:

    ClearCollect( AcctInfo, {CompanyCode:"", GenLedAcct:"", ProCenter:"", CostCenter:"", WBS:"", IntOrder:"", Amount:"", TaxAllCode:"", TaxJurCode:"", Desc:"", TradPart:"", ShowSaveButtons: true })

     

    I tried using Amount: 0 but get errors.
    Not sure if Amount in the collection needs to be a number/value column, and if so, how to set it that way OnStart?

  • eka24 Profile Picture
    20,925 on at

    In your collection, do you have the trailing zero?
    gg.PNG

    ------------

    If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    No trailing zeroes in the collection, nor the field once I click the button that runs the Patch command.

    Enter amount:

    samntpatchbut.png

    after pressing the Save Button which runs the Patch command:

    amntpatchbut2.png

    Collection shows .2 rather then .20:

    amntcol.png 

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    After trying multiple work arounds ( Setting Account to Amount: Blank(), Forcing #.## in the text input field, etc.) and still losing the trailing zeroes I have opened an incident with Microsoft to see if they have a resolution. 

    Something else to note..

     

    As I mentioned, the user can add multiple items to the "Repeating Table" ( following the steps from Shane Young ) and when summing up the Amount in the collection ( Sum( AcctInfo, Amount) ), it also loses the trailing zeroes.

    So if they enter 100.18 on one line, and 100.02 on a 2nd line, then the sum comes back as 200.2

     

    In the SharePoint list the items are not losing the zeroes.. so it seems to be a "Display issue" in the App and not a value issue:

    shanemeisner_0-1620301950161.png

     

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Two days later.. No resolution yet from Microsoft.

    So, I created a copy of my App and since for whatever reason I Can't change Amount: "" to Amount: 0 , I removed Amount and added "LineAmount: 0" :

     

    If(IsBlank(ListItemID),ClearCollect(AcctInfo,{CompanyCode:"", GenLedAcct:"", ProCenter:"", CostCenter:"", WBS:"", IntOrder:"", LineAmount: 0, TaxAllCode:"", TaxJurCode:"", Desc:"", TradPart:"", ShowSaveButtons: true }),//if a new item then create empty collection// 

     

    Then in my Amountval field I added this formula for the Default: Text( ThisItem.LineAmount, "#.00")

    and now the Amount entered in that field keeps the trailing zero after clicking the "Save Row" button":

    shanemeisner_0-1620392537165.png

    Unfortunately when I save that row, the Patch: LineAmount( LineAmount: Value(AmountVal.Text))
    is still dropping the trailing zero:

    shanemeisner_1-1620392592035.png

    I've tried multiple ways to try and force the Patch to include the trailing zeroes including this:

    LineAmount: Value(Text( ThisItem.LineAmount, "[$-en-US]#.00"))

    There are no errors, but it still drops the trailing zero. 

    I feel I am this close to figuring this out, but the Patch command is kicking my butt..

    Any ideas??

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 Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Valantis Profile Picture

Valantis 431

#2
WarrenBelz Profile Picture

WarrenBelz 360 Most Valuable Professional

#3
Kalathiya Profile Picture

Kalathiya 280 Super User 2026 Season 1

Last 30 days Overall leaderboard