Pregunta

I have a SharePoint list with a column that is displayed as a percentage: the minimum value is 0, the maximum is 100:

enter image description here

This is displayed nicely as percentage value, i.e. 11%

enter image description here

However, when I am trying to use PowerApps as an input form, it allows only values between 0 and 1

enter image description here

How to allow users to enter the percentage value instead of a fraction (so 11% instead of 0.11)?

¿Fue útil?

Solución

You can try the following approach:

enter image description here

Here "Numbers" is the name of my column.

This makes both the display of the value (The Default property) and the function that updates it (Update) stores the value correctly.

Otros consejos

Per my test, percentage is acceptable in PowerApps form. Symbol % needs to be typed in manually as well.

Please point it out if I have misunderstood your situation.

enter image description here

This is default behavior in PowerApps for number fields which are being shown as percentage in SharePoint because it stores values from 0 to 1 in back-end.

Workaround:

  1. Change your number field to regular number field (by removing show as percentage in column settings).
  2. Use JSON/Column formatting to show this field as percentage in list view.
{
   "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
   "elmType": "div",
   "txtContent": "= @currentField + '%'"
}

Output:

enter image description here

References:

  1. Use column formatting to customize SharePoint.

The SharePoint answer is simple - no JSON code is required. A percentage is a decimal value less than 1. If you want your column to read 44%, then you have to enter it at .44. SharePoint will convert it to a % in the column. This will work regardless of how people enter data in your list - default form, quick edit, details pane, etc.

As for getting it to display in Power Apps, I'm working on that myself. I assume it has to do with Format.

Licenciado bajo: CC-BY-SA con atribución
scroll top