Forum Discussion

W_AT_H's avatar
W_AT_H
Copper Contributor
Aug 14, 2025
Solved

Automated Lists numbering in PowerAutomate

Hi All,

I could use some advice on a automated stream I created which is coupled to an online Microsoft List on a Sharepoint site. I want this stream to act when a new list item is created through a form to lookup the numbers in the first column. Determine the highest number that is already present and then assign a new number to the new item that is 1 higher than the highest present number. 

If the column has 185, 272, 284 already present, I want the stream to fill in 285 with the new item.

The problem is that I keep getting this error for the last step 'edit item'

The 'inputs.parameters' of workflow operation 'Item_bijwerken' of type 'OpenApiConnection' is not valid. Error details: Input parameter 'item/CVB_x0020_nummer' is required to be of type 'Number/double'. The runtime value '"float(add(coalesce(int(outputs('Samenstellen')), 0), 1))"' to be converted doesn't have the expected format 'Number/double'.

For this last step I use the output of the previous step which has this as it's input parameters. All the additions added to make sure that the output is a number. But with or without 'float', 'int' 'coalesce', I keep getting the same error:

float(add(coalesce(int(outputs('Samenstellen')), 0), 1))

When I ask the AI what the output of this step is, it correctly states that this is a number. The EDIT ITEM step is trying to edit the correct item id. The Lists column is set to 'number'. If I switch that to text than the stream fails outright when fetching data so the input is number as well.


I can't seem to figure out what is going wrong. And I hope someone here can help. Thank you.

  • 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)

3 Replies

  • Rob_Elliott's avatar
    Rob_Elliott
    Bronze Contributor

    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)

    • W_AT_H's avatar
      W_AT_H
      Copper Contributor

      Hi Rob,
      Working witht he variables eventually solved it. That was some great advice. Thank you very much.

      Weirdly I had to set the variable to float at initialize step. Otherwise it would keep failing. Still, solved and happy.

      - Stef

  • pradejain's avatar
    pradejain
    Iron Contributor

    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

Resources