cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Responsive Resident
Responsive Resident

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

 

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 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.

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support
Community Support

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

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,

 

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
Highlighted
Community Support
Community Support

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

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,

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Highlighted
Responsive Resident
Responsive Resident

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

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. 

 

Highlighted
Community Support
Community Support

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

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,

 

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Watch Now

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (7,105)