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 / How to format text inp...
Power Apps
Answered

How to format text input Datacard to decimal and add euro as defaults using sum of collection records

(0) ShareShare
ReportReport
Posted on by 825
 

Hi @v-qiaqi-msft,

 I have tried the solution as you showed in this link posted below

 

 

https://powerusers.microsoft.com/t5/Building-Power-Apps/How-to-format-text-input-datacard-to-decimal-and-add-euro-as/m-p/655806/highlight/true#M208762 

 

and I got the following error 

 

 

 

Thanks for your help so far, but I had some issue, and what I wanted, is giving me a problem in my collection, such that when I add the total to collection it is not showing me the Sum(addition) can you please let me know why Sir?

Please have a look at my output as you said and showed its working fine, but my collection is not working now, week total shows the sum records of all the total is added 

 

e.g : total = 10, 10 10,

weektotal should be : 30 

 

 

Please see that on default of my weektotal: 

 

 

"€" & Sum(Recordss, TotalItems)

 

 

and On addbutton the collection is:

 

 

Collect(Recordss, 
{
 GItems: Text(Dropdown1.Selected.Value),
 TotalItems:DataCardValue43.Text,
 RDate: DataCardValue2.SelectedDate,
 Description: DataCardValue1.Text
});

 

 

 

Please note that in above formula

GItems is weektotal card 

                                             and                                                 

totalItems is Total Card as shown in below screenshot.

 

 

 

Thanks a lot for your help so far sir @v-qiaqi-msft if you can help me with this error would be glad sir. 

 

 Tapesh_0-1597397665814.pngTapesh_2-1597312776100.png

 

Thank you.

 

Categories:
  • v-yutliu-msft Profile Picture
    Microsoft Employee on at

    Hi @Tapesh ,

    Is this your problem: weektotal display blank by default by using this formula?

    "€" & Sum(Recordss, TotalItems)

    I 've notice that you use this to patch TotalItems field.

    DataCardValue43.Text

     If so, the problem is that:
    1)TotalItems field is text type

    2)Sum() function is used to calculate number field.

     

    So to display the right weektotal, you should use Value() function to transfer text to number.

    Try to set weektotal's Default like this:

    "€" & Sum(Recordss, Value(TotalItems))

     

     

     

    Best regards,

  • Tapesh Profile Picture
    825 on at

    Hi @v-yutliu-msft 

     

    Thank you so much for your reply i tried the way you have provided me the solution, however this still does not work me. 

     

    Please see the current  code's on 

    On DataCard PerDaytotal

    Default of Per day Total,  Textinput:  

    If(!IsBlank(var3),var3,"") // In case, please indentify the if the var3 is blank

     

    On change of Textinput:  

    Set(
     var3,
     Text(
     Value(
     DataCardValue43.Text,
     "en-US"
     ),
     "[$-en-US]##.00"
     ) & " € "
     ) 

     

    On Format Of textInput: 

    TextFormat.Text

    On DataCard Weeklytotal

    ON  Default Textinput: 

    Sum(Recordss, Value(TotalItems))

     

    On change: False 

    Format : 

    TextFormat.Text

     

    Collection Items 

     

    On Select of a button :

     

    Collect(Recordss, 
    {
     GItems: Text(GLCodesDrpdwn.Selected.Value),
     TotalItems:Value(Text(DataCardValue43.Text)),
     RDate: DataCardValue2.SelectedDate,
     Description: DataCardValue1.Text
    });

     

     

    I also tried this on Select of button 

     

    Collect(Recordss, 
    {
     GItems: Text(GLCodesDrpdwn.Selected.Value),
     TotalItems:(Text(DataCardValue43.Text)),
     RDate: DataCardValue2.SelectedDate,
     Description: DataCardValue1.Text
    });

    ON Gallery Which shows the collection of Day total

     

    Lable Text: 

    Value(ThisItem.TotalItems)

     

     

     

     

    Tapesh_0-1597846256778.png

     

    Any luck on this sir. 

     

     

    Thanks in advance. 

     

  • Verified answer
    v-yutliu-msft Profile Picture
    Microsoft Employee on at

    Hi @Tapesh ,

    The reason why you still have problem is that you add "€" in  DataCardValue43. So please do not directly use Value() function to transfer DataCardValue43.Text. To use  Value() function to transfer text to number, you need to make sure the text data only includes number.

    Try to set like this:

    On DataCard PerDaytotal

    Default of Per day Total,  Textinput:  

    If(!IsBlank(var3),var3,"") // In case, please indentify the if the var3 is blank

     

    On change of Textinput:  

    Set(
     var3,
     Text(
     Value(
     DataCardValue43.Text,
     "en-US"
     ),
     "[$-en-US]##.00"
     ) & " € "
     ) 

     

    On Format Of textInput: 

    TextFormat.Text

    On DataCard Weeklytotal

    ON  Default Textinput: 

    Sum(Recordss, TotalItems)

    //TotalItems is number data type, you do not need to use Value() function any more.

     

    On change: False 

    Format : 

    TextFormat.Text

     

    Collection Items 

     

    On Select of a button :

     

    Collect(Recordss, 
    {
     GItems: Text(GLCodesDrpdwn.Selected.Value),
     TotalItems:Value(Match(DataCardValue43.Text,"[0-9]+").FullMatch),
     RDate: DataCardValue2.SelectedDate,
     Description: DataCardValue1.Text
    });

    //Value(Match(DataCardValue43.Text,"[0-9]+").FullMatch) only represent the number value in datacard43 and have been transferred to number type. So TotalItems is number data type.

     

    Best regards,

     

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

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 248 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 192 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 135

Last 30 days Overall leaderboard