Skip to main content

Notifications

Community site session details

Community site session details

Session Id : zMc2wNUHCwzCUY3m26zIeo
Power Apps - Building Power Apps
Unanswered

Free Text or formatted number in Power Apps control

Like (0) ShareShare
ReportReport
Posted on 19 Jun 2023 10:30:52 by

Hi Community,

 

I should like the option for users to post free text in a Power Apps text control, otherwise post a number formatted as a percentage.

My App is partially pre populated with text and numbers (mostly as percentages).

@WarrenBelzhelped me with a scenario to report "Not Applicable" if the SharePoint control was blank, but now our users rather want the option to type free text if no data (blank SharePoint record) is pulled into the control.

 

The code to show "Not Applicable" or pull through the percentage was as follows:

 

 

If(
 IsBlank(Parent.Default),
 "Not Applicable",
 Text( 
 Value(Parent.Default) * 100, 
 "#%" 
 ) 
)

 

 

 

How do I correct this permit the user post free text unto 255 characters. Thankyou!

 

 

  • Community Power Platform Member Profile Picture
    on 28 Jun 2023 at 13:54:24
    Re: Free Text or formatted number in Power Apps control

    @timl,

     

    So the comma on your first line corrects formula errors but the control blocks the addition of free text. 

    I tried this with data formatted as number and as single line text.

  • timl Profile Picture
    34,955 Super User 2025 Season 1 on 20 Jun 2023 at 15:38:08
    Re: Free Text or formatted number in Power Apps control

    @Anonymous - apologies, there was a missing comma after the IsNumeric line. Can you try this to see if it works better?

    If(
     IsNumeric(Parent.Default),
     Text( 
     Value(Parent.Default) * 100, 
     "#%" 
     ),
     Value(Parent.Default)
    )

     

  • Community Power Platform Member Profile Picture
    on 20 Jun 2023 at 10:34:40
    Re: Free Text or formatted number in Power Apps control

    @timl Other error messages in detail;;

     

    mc00515_2-1687257196189.png

    mc00515_3-1687257241626.png

    mc00515_4-1687257273684.png

     

     

  • Community Power Platform Member Profile Picture
    on 20 Jun 2023 at 10:21:47
    Re: Free Text or formatted number in Power Apps control

     @timl   When I add your code to the default property of the control...

     

     

    If(
     IsNumeric(Parent.Default)
     Text( 
     Value(Parent.Default) * 100, 
     "#%" 
     ),
     Value(Parent.Default)
    )

     

     

     

    This now produces 5 formula errors:

     

    mc00515_0-1687256499059.png

    Detail error view:

     

    mc00515_1-1687256975686.png

     

  • Community Power Platform Member Profile Picture
    on 20 Jun 2023 at 09:55:42
    Re: Free Text or formatted number in Power Apps control

    @timl The problem occurs when I change from one format to another. I get the warning.. see screen shot...

    mc00515_3-1687256104652.png

     

    If I refresh the app

    mc00515_1-1687254239013.png

    It patches any text into SP

    mc00515_2-1687254311696.png

    Then when I change back to number...

    mc00515_3-1687254387739.png

    It patches without any further issue (but note it doesn't automatically put the % in the control.)

    mc00515_4-1687254468045.png

    So now I have 2 issues. Some of the data is showing percenatges like this 0.78

    While the test control is showing 99 without the %, until I actually add %.

    mc00515_5-1687254557227.png

     

    Then the server message reappears

    mc00515_1-1687255938479.png

     

    If I refresh it again, this happens

    mc00515_7-1687254689933.png

     

    Then 9900% automatically appears in the control

     

    mc00515_8-1687254761645.png

    However, now it lets me patch the data correctly:

    mc00515_9-1687254821804.png

     

    Now if I change the entry to text again...

     

    mc00515_10-1687254890555.png

    and the cycle continues..

     

    mc00515_2-1687256044817.png

     

     

    That above however is using your original code;

     

     

     

     

    If(
     IsBlank(Parent.Default),
     "",
     Text( 
     Value(Parent.Default) * 100, 
     "#%" 
     ) 
    )

     

     

     

     

    I'm going to try your modified code now.....

  • timl Profile Picture
    34,955 Super User 2025 Season 1 on 20 Jun 2023 at 09:35:13
    Re: Free Text or formatted number in Power Apps control

    @Anonymous - that's really wierd if 'format' is set to 'text' and it doesn't enable you to type anything other than a number.

    I'd try refreshing the data source in the data panel and recreating the card from the 'fields' link of the form property. Maybe that might help.

  • Community Power Platform Member Profile Picture
    on 20 Jun 2023 at 09:21:48
    Re: Free Text or formatted number in Power Apps control

    Thanks for getting back to me on this @timl , I was about to abandon the notion of a solution - at least for a season until MS come up with a workable solution. I'll give everyone a heads up here, in my labours to test your previous options I have uncovered another error that is related, but have reported elsewhere (I had been advised by another super user not overload each query with multiple questions and asks. That said, if it will help anyone reading this understand better about the scope of my endeavours, a link is here. ) Now back to answer your questions...

     


    @timl wrote:

    Hi @Anonymous 

    Thanks for clarifying that.

    When loading a record, formula beneath will format the value as a percentage if the underlying value is a number. Otherwise, it will set it to the text value.

     

     

    If(
     IsNumeric(Parent.Default)
     Text( 
     Value(Parent.Default) * 100, 
     "#%" 
     ),
     Value(Parent.Default)
    )

     

     

     

    If you still want it to display "not applicable" when blank, the formula would look like this.

     

     

    If(
     IsBlank(Parent.Default),
     "Not Applicable",
     IsNumeric(Parent.Default)
     Text( 
     Value(Parent.Default) * 100, 
     "#%" 
     ),
     Value(Parent.Default)
    )

     

     

     

    With regards to the text input control not accepting a number, can you confirm the format property of the control? Is it set the 'Text'?

    mc00515_0-1687252846969.png

    The control I have used the above control "Percentage_Test" for test purposes only. I set it to Single line text on SP.

     

    Another issue I have discovered. When I changed the columns (scoped to accept text and %) from Number to Single line Text, while there was no loss of data incurred (something SP warns you against), I lose the %.  For eg 78% now appears as 0.77.

     

    It seems to me then, please correct me if I am wrong, that what you gain on the app by offering the option to enter data as text or %, you lose it at the SP end.

     




     

     

     

     

     

  • timl Profile Picture
    34,955 Super User 2025 Season 1 on 20 Jun 2023 at 08:42:01
    Re: Free Text or formatted number in Power Apps control

    Hi @Anonymous 

    Thanks for clarifying that.

    When loading a record, formula beneath will format the value as a percentage if the underlying value is a number. Otherwise, it will set it to the text value.

    If(
     IsNumeric(Parent.Default)
     Text( 
     Value(Parent.Default) * 100, 
     "#%" 
     ),
     Value(Parent.Default)
    )
    

     

    If you still want it to display "not applicable" when blank, the formula would look like this.

    If(
     IsBlank(Parent.Default),
     "Not Applicable",
     IsNumeric(Parent.Default)
     Text( 
     Value(Parent.Default) * 100, 
     "#%" 
     ),
     Value(Parent.Default)
    )

     

    With regards to the text input control not accepting a number, can you confirm the format property of the control? Is it set the 'Text'?

  • Community Power Platform Member Profile Picture
    on 19 Jun 2023 at 14:55:26
    Re: Free Text or formatted number in Power Apps control

    Hi @timl The problem I'm having if I go with your solution, even if I set Max Length to 255

    mc00515_0-1687186346983.pngmc00515_1-1687186417905.png

    When I attempt to type anything other than a number, the input control 'Achievement' doesn't permit it. If you are saying it should work, what am I doing wrong?

  • Community Power Platform Member Profile Picture
    on 19 Jun 2023 at 12:15:15
    Re: Free Text or formatted number in Power Apps control

    Hi @timl 

    SharePoint columns( in some instances) have been pre-populated with numbers. These were originally formatted as percentages. The need to arose to adjust the formatting to include text in addition to numbers formatted as percentages.

     

    Records in SP (ie numbers or blanks) are pulled into certain controls in the Power App. Image below ( red question marks where blanks or number can be pulled in from SP):

    mc00515_0-1687176123532.png

    If a number is pulled in, it must be formatted in the app as a percentage (as in the case of Attendance, Retention or Achievement)

    Alternatively, if a blank is pulled into those same controls, the user is required to add free text (<255 characters)

     

    Our efforts so far only offer the user the option to insert a number (formatted a percentage) or "Not Applicable" or retain a blank.

     

    Users need to free text or provide a number formatted as percentage. If the number already exists, users will use the record for observation purposes only. If a blank is pulled  into the control (via the gallery), users need to be able to free text and have the edit form submit that free text back to SP.

     

    Hope that makes sense. 

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

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,695 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 66,015 Most Valuable Professional

Leaderboard