cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
johandezeeuw
Level: Powered On

Formatting DataCardValue number

Hello - I have a number which is shown as 13000 while I would like it to appear as 13,000 or later also as USD 13,000.00 - How can I do this?

 

At present the Text property is shown as just "parent.default"

Thx!

JonathanWest
Level: Powered On

Re: Formatting DataCardValue number

@johandezeeuw

 

The text function I believe is what you are looking for.

 

https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-text

 

You can use this function to format text and in your instance, use it like this.

 

Text(parent.default,"[$-en-US]$###,####.00")

 

johandezeeuw
Level: Powered On

Re: Formatting DataCardValue number

Dear Jonathan - thanks for your response. I have used this but without success (the formatting appers with comma's). Could it be the issue that the source table (SQL Azure) has "float" as property?

 

Thanks!

Johan

JonathanWest
Level: Powered On

Re: Formatting DataCardValue number

@johandezeeuw

 

Unfortunately, I don't have experience with SQL Azure, only on-prem SQL. Could you elaborate or share screenshots on 


@johandezeeuw wrote:

I have used this but without success (the formatting appers with comma's).

 

Edit: formatting stuff

lauriewheeler
Level: Powered On

Re: Formatting DataCardValue number

The Text() function doesn't seem to work for Canvas App connected to SharePoint lists, using a Form control. The same list, duplicated in Classic, works perfect in InfoPath, but not in PowerApps. NO formula I have tried works. The field in SharePoint is Number. I've tried the formula in the in the datacard and in the datacardvalue. Text(Parent.Default,"[$-en-US]$ #,###") <-Doesn't work Text(ThisItem.fieldName,"[$-en-US]$ #,###")<-Doesn't work I even changed the field to a text field in SharePoint, refreshed the data source and tried these formula's and they aren't working. What am I missing?
JonathanWest
Level: Powered On

Re: Formatting DataCardValue number

@lauriewheeler Are you trying to format users input as they type? Or are you trying to format data that has already been stored?

bhitchlock
Level: Powered On

Re: Formatting DataCardValue number

Hi lauriewheeler,

 

Some SharePoint columns (Calculated Columns) return a Text value rather than a number. Since the Text function only works for Number and Date/Time values applying it to a string won't work. Try putting Parent.Default in a Value function as follows:

 

Text(Value(Parent.Default),"[$-en-US]$ #,###")
lauriewheeler
Level: Powered On

Re: Formatting DataCardValue number

curiousier and curiousier.  I tried that formula too, to no avail.  Maybe it is my setup?   Our PowerApp Release is: 3.18122.23.  This is a Canvas App, with a Form connected to a custom SharePoint list.   The PDF file attached shows screen shots of the  DataCardValue configuration and the associated SharePoint column configuration.  I even tried a complete separate (text only) field with the formula and all my results are the same.  
So to recap:  I've tried various 'Text()' functions on the 'Default' field on DataCardValue and on the DataCard itself.  I've tried coverting the field to text, and tried the function on the 'Default' field on DataCardValue and on the DataCard itself.  I tried the formula on a unrelated 'text' field on the 'Default' field on DataCardValue and on the DataCard itself.  After each iteration, I have refreshed the datasource, saved and published. All return the same results.

 

Would I have a better chance trying to do a Datasheet, or Gallery?   Should I just create a blank Form with TextInput boxes, connect the datasource and bind the fields manually? 

bhitchlock
Level: Powered On

Re: Formatting DataCardValue number

Hi Laurie,

I had a look and I have multiple identical currency fields in one of my lists and all are formatted Text (Parent.Default, "[$-en-US]$ #,###") or (Value(Parent.Default), "[$-en-US]$ #,###") for the Calculated fields in PowerApps.  I'm on the same release. So I'm not sure why it wouldn't work for you.

 

You might try building a new quick app from the data and see if the formatting works on the same fields there. That would at least identify/eliminate an issue with your app.

 

 

 

 

lauriewheeler
Level: Powered On

Re: Formatting DataCardValue number

I did do a new app and tested it, same thing occurs.  

I did also, just go into the SharePoint list and under PowerApps, choose Customize Forms. Once PowerApps opened up the default form - I tried the formula on the DataCardValue and it works. In the attachment here, you see the first card shows the formatting, the card next to it, I haven't touched yet.  

 

The only difference I can see in the configuraitons (beside one being a canvas app) is when customizing the form there appears the SharePointIntegrations showing under the screen 1 on the left hand side.

 

How to I add that SharePointIntegrations item to my Canvas app, or will I have to figure out how to do this... 
{Value:?, 

'@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SharePointIntegrations",........?????

}   

I'm fairly new to PowerApps, so I'm not versed on those odata type and how to use them. I have used a similar method from an example from Laura Rogers to pass a selected value from a gallery to a form for a separate list.

 


So, the real question is 'why' the difference?     If I have to use the customzied form... then I will be spending another 40 hours to format the form.... list has over 56 columns.

 

Is this a SharePoint online configuration thing,  or my access level or licensing of PowerApps. 

Our organization is E3, but we do not have PowerApps Plan 1 or 2.  I am a SharePoint Administrator, I am not a Global Adminstrator.