I've imported data from an Excel file into a PowerApp. One of the columns is called "SectionNumber" and it may be a 1, 2 or 3 digit number or a single text character. I want to format this such that if it's a number, it's always displayed as 3 digits, with leading zeroes as needed (e.g.: "1" would display at "001").
The formula I'm using for this is:
I've also tried varying combinations of # and 0 inside the double quotes, but none are producing the output I want. What am I doing wrong here?
Solved! Go to Solution.
Thanks @timl. That's precisely what I had in mind when I asked about how the single character value should be displayed.
Will this method always add 2 - leading 0's to the input or will it adjust to fit the 3 digit criteria?
1 = 001
2 = 002
10 = 010 or 0010
This returns the number 1 so that it is 3 digits long and fills in leading zeroes as needed: 001
If you try the "000" format against a number that is longer than 3 digits, it will exceed 3 digits: 1000
What are you looking to do?
I'm trying to do something similar but on a number field, for instance for Month (1 would be 01), etc. I have my number field set to only be 2 digits.
A number column will never have leading zeros. Leading zeros is about "format" of a number. So, you will not be able to store a number as 01 in your data numeric column. You can store it in a text column as such.
If you are trying to go the other way with it - you have 1 in the number column and want to display 01 - then use the following : Text(yourNumberColumn, "00")
i.e. Text(1, "00") will show "01"
You would add the Text formula to your Update property of the datacard.
Check out the News & Announcements to learn more.
Check out the new Power Platform Community Connections gallery!
Congratulations, the new Super User Season 2 for 2021 has started!
Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.