Make Keeps Treating My Number as Text

What are you trying to achieve?

I’m trying to automatically generate the next order number in Notion using Make.
Each time a new order is submitted, I want Make to:
1. Look up the latest existing order number from a Notion database property (stored as rich text),
2. Convert that value to a number,
3. Add 1 to it,
4. Write the result into a Number field in Notion called Order Number.

The entire flow works until the last step, where Make seems to treat the number as plain text and causes a validation error in the Notion module (Invalid number in parameter ‘z_Tg’). I want the value to be treated and inserted as a true number, not a string.

Steps taken so far

  1. Created a Notion database with a rich text field called Order ID (Text) and a number field called Order Number.
    2. Used the Notion “Search Objects” module to retrieve the latest submitted order and get the value from the Order ID (Text) field.
    3. Added a Tools > Set Variable module with this expression:
    add(1; toNumber(ifempty(get(1; “properties.Order ID (Text).rich_text[0].plain_text”); 0)))
    4. Tried wrapping the output in toString(…) and eval(…) as well, but it didn’t change the result.
    5. Mapped the output to the Order Number field in the Notion Create/Update module.
    6. Keep getting a BundleValidationError with the message:
    “Invalid number in parameter ‘z_Tg’.”
    7. Also tried changing the Order Number field in Notion from a number to a text field, but that caused other problems.

Welcome to the Make community!

This is not the correct way to sum two numbers together.

  • You cannot use the array function add on a number.
  • There is no such function toNumber.
{{ 1 + parseNumber(first(1.properties.id.rich_text.1.plain_text)) }}

(copy-paste the above into the field, or type it exactly as shown)

Hope this helps! Let me know if there are any further questions or issues. P.S.: investing some effort into the tutorials in the Make Academy will save you lots of time and frustration using Make!

@samliew