I am currently having issues with formatting a number column used for percentages. 0 - 100%. I have the column formatted to not use the decimal in the SharePoint list. However in the power automate flow it uses the decimal. My issue is either formatting numbers with for all whether that be an expression or using the apply to each so I can apply it to "Select" before adding it into the Create HTML Table to show a percentage without a decimal. Any help would greatly be appreciated. I didn't see much out there for applying format number to apply to each when getting items using the select function.
Solved! Go to Solution.
Hi @Leu0101,
One of your items in the list has an empty percentage complete column.
The current expression cannot handle that. It tries to format a value which does not exist. If you want to take empty values into account you could add a check for empty into the existing expression.
Below is an example of that:
if(empty(string(item()?['PercentageComplete'])), '0', formatnumber(item()?['PercentageComplete'], '0'))
Hi @Leu0101,
Like your screenshot already suggests, you could use a formatnumber function with the Zero placeholder format in the Select.
Try something like the example below.
You might need to change the name of the column, I guessed your column name 😁
formatnumber(item()['PercentageComplete'], '0')
I gave it a shot but it looks like I am encountering a error. I could only assume that maybe my column is formatted incorrectly? I used:
Hi @Leu0101,
One of your items in the list has an empty percentage complete column.
The current expression cannot handle that. It tries to format a value which does not exist. If you want to take empty values into account you could add a check for empty into the existing expression.
Below is an example of that:
if(empty(string(item()?['PercentageComplete'])), '0', formatnumber(item()?['PercentageComplete'], '0'))
Ahh that's what it is! Thank you for your help! Much appreciated!