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:
Text(SectionNumber,"[$-en-US]000")
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?
Hi Guys,
I'm enjoying this conversation!
@ChadVKealey - I think you did the right thing by adding a column to Excel. It's the quickest and easiest fix.
But going back to the original question, it seems to me that the simple rule that we're looking for is this.
If (input is numeric) => convert it to a number and format it Else => leave it as it is
If that's the case, we can apply this type of formula (assuming our input comes from the TextInput1 control):
If(IsNumeric(TextInput1.Text),
Text(Value(TextInput1.Text),"000"),
TextInput1.Text
)
(Well done to @LRVinNC for the numeric formatting expression!)
WarrenBelz
250
Most Valuable Professional
MS.Ragavendar
126
stampcoin
115