Forum Discussion
Automated Lists numbering in PowerAutomate
- Aug 15, 2025
W_AT_H an alternative way to do this is shown below. The current maximum number is 232 and the expected new maximum number is 233. As you'll see, the flow runs successfully and creates the new item with the correct number.
The CountryID is a number column.To get the current maximum number sort the list by CountryID descending and just bring back the top 1:
Add an apply to each and add a compose with the expression int(item()?['CountryID']). Set the variable you initialized earlier with the outputs of the compose: Then add an increment variable action and set it to increment by 1.
Use the variable for the CountryID of the new list item.
This is the result.
Rob
Los Gallardos
Microsoft Power Automate Community Super User.
Principal Consultant, SharePoint and Power Platform WSP Global (and classic 1967 Morris Traveller driver)
I’ve seen this exact issue before in Power Automate when working with SharePoint list Number columns — the error message makes it look like your expression is producing a number. However, in reality, Power Automate is still treating it as a string because of how it’s passed between steps.
SharePoint Number columns in Power Automate require the JSON payload to contain a real numeric type (Number/double), not a quoted value.
If your expression results in something that’s wrapped in quotes, SharePoint will reject it.
In your case: float(add(coalesce(int(outputs('Samenstellen')), 0), 1))
produces a number during evaluation — but if outputs('Samenstellen') is coming from a Compose or similar text-based step, Power Automate may still store it as a string
solution
Use outputs() directly without string wrapper.
So instead of float(add(coalesce(int(outputs('Samenstellen')), 0), 1)), use add(coalesce(int(outputs('Samenstellen')), 0), 1)
The add() function in Power Automate returns a number natively, so you don’t need float() unless you’re dealing with decimals.
All the best