web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Text input display exi...
Power Apps
Answered

Text input display existing value but also format as percentage

(0) ShareShare
ReportReport
Posted on by 112

I'm building a form in PowerApps where I have multiple text input fields where users can input goal percentages that are patched into a SharePoint list. I want these fields to display the numbers entered as percentages which I have working by modifying the following properties of the text input field:

 

OnChange: Set(var1,Value(DataCardValue104.Text)*100&"%")

Default: var1

 

However this removes my ability to display any existing values that may be present in the record stored in the list as this is accomplished using Parent.Default. My data card's default is 

 

ThisItem.'Column Name'

 

 

Is it possible to both display an existing value from the record (if present) as a percentage AND allow the user to enter new values that will be displayed as a percentage?

Categories:
  • Chris-D Profile Picture
    1,246 on at

    The immediate problem I see with this is that if users enters a % sign themselves, the formula breaks because Value() is expecting a number. 

    It's unusual in any form like this to include the units in the input. If you're expecting a percentage input, prompt the user for a number 0-100 and just add a text label with a % sign next to the box? 

  • SebS Profile Picture
    4,874 Super User 2026 Season 2 on at

    @entertain89 @Chris-D 

     

    If User type 10% and You wrap it in Value() the result passed to SharePoint List number column will be 0.1 there is no issue with user typing the % Power Apps will handle it.

     

    to retrieve % from data source You will need to wrap it in Text() to show it correctly to user

     

     

     

    Text(ThisItem.'Column Name'*100, "0%")

     

     

     

    You can also handle both scenario when user add % or not add it and properly Patch it to the record

     

    Here is an example how You could handle scenario where user can place 10 or 10% and You will not have any issue with properly displaying this back to the user as a %

     

     

    Set(Number,If(Int(TextInput2.Text),Value(TextInput2.Text)/100,Value(TextInput2.Text)))

     

    Than use this code to display record in %

     

    Text(Number*100, "0%")

     

  • CU23010049-0 Profile Picture
    112 on at

    @Chris-D

    I hadn't really given much thought to the different ways user's might try to input things yet. I was more exploring if its even possible without a totally custom coded solution (beyond my abilities at this time). You are correct though my current OnChange code wouldn't handle users entering whole numbers, it assumes an input range of 0.01-1 as the column is of percentage type rather than number.

     

    @SebS 

    Could you elaborate on where to place your code examples? I assume they go in the actual input fields themselves but which property?

     

    Overall I don't have my heart set on doing things specifically this way. I just need some way for users to enter numbers that will be goal percentages (whether that is as 0.1 or 10 or 10% I don't really care), be displayed as percentanges to end users, and have those values patched into a list. So if there is a better way to accomplish this I'm all ears.

  • SebS Profile Picture
    4,874 Super User 2026 Season 2 on at

    @entertain89 

     

    Assuming You using a form and DataCardValue104.Text is the field where the user inputs the % value. This field is part of a DataCard, and this card has a property called Update

     

    SebS_0-1693419883694.png

     

    To use the code and Update DataSource place below  code to Update the Property of that DataCard

     

     

     

    If(Int(DataCardValue104.Text),Value(DataCardValue104.Text)/100,Value(DataCardValue104.Text))

     

     

     

    now in the gallery where you display % value use :

     

     

     

    Text(ThisItem.'Column Name'*100, "0%")

     

     

  • CU23010049-0 Profile Picture
    112 on at

    I am not using a gallery component to display the data. Can the input text box not serve as both an input area as well as a display for the new/existing value? If so what property should 

    Text(ThisItem.'column name'*100, "0%")

    be placed in? 

  • SebS Profile Picture
    4,874 Super User 2026 Season 2 on at

    @entertain89 

     

    Yes, I missed that bit just in case you want to use Edit or View in your form 🙂

     

    To sort this one go to the Default property

     

    SebS_0-1693421513745.png

     

    And wrap the Parent.Default in the Text() function like below

     

    Text(Parent.Default*100, "0%")

     

  • SebS Profile Picture
    4,874 Super User 2026 Season 2 on at

    @entertain89 

     

    Yes, I missed that bit just in case you want to use Edit or View in your form 🙂

     

    To sort this one go to the Default property

     

    SebS_0-1693421513745.png

     

    And wrap the Parent.Default in the Text() function like below

     

    Text(Parent.Default*100, "0%")

     

  • CU23010049-0 Profile Picture
    112 on at

    Ok, we're almost there! Now the field properly displays percentages if I enter in decimal format (0.01) and percentage form (1%) but if I enter it as a percentage without the percent sign (ie 10) it will multiply that by 100 leaving me with a value of 1000% which patch won't accept:

    entertain89_0-1693422363871.png

     

     

    Could this be handled with an if statement to check how the numbers are entered?

     

    It's not the end of the world, I can always just post a notice above the fields instructing users to enter as a decimal or a percentage with the percent sign. But if its not to much hassle being able to handle all three input scenarios would be great.

  • SebS Profile Picture
    4,874 Super User 2026 Season 2 on at

    @entertain89 

     

    What is precisely the Value you enter when it crash?

     

    Here is my Column

     

    SebS_0-1693423702662.png

     

    Here is my Grade input Default

     

    SebS_1-1693423925594.png

     

    Here is my Grade input Update

     

    SebS_2-1693423963847.png

     

     

    Now, here is my solution in action

     

    SebS_3-1693423976531.gif

     

  • CU23010049-0 Profile Picture
    112 on at

    Here is my column (i have multiple columns, all set the same):

    entertain89_0-1693424493934.png

     

    Here is  my goal inuput default:

    entertain89_1-1693424538180.png

     

     

    Here is my goal card update property:

    entertain89_2-1693424585800.png

     

     

    Here are my attempts.

     

    Works:

    entertain89_3-1693424642531.png

     

     

    Works: 

    entertain89_4-1693424671375.png

     

    Fails with error:

    entertain89_5-1693424704008.png

    entertain89_6-1693425179432.png

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 342 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 258

#3
Mohsin Ali Profile Picture

Mohsin Ali 231

Last 30 days Overall leaderboard