Creating Notion Item with dynamic variables

:bullseye: What is your goal?

Creating a Data Source Item on Notion module with dynamic variables

:thinking: What is the problem & what have you tried?

All input are filled out. How to prevent from this error?

:clipboard: Error messages or input/output bundles

The run couldn’t be completed
[400] body failed validation. Fix one:
body.properties.Problème.title should be defined, instead was undefined.
body.properties.Problème.rich_text should…
[…]
Code: RuntimeError
Origin: Notion

:camera_with_flash: Screenshots (scenario flow, module settings, errors)

That error is Notion’s way of saying that a property came through empty or in the wrong shape. The “Fix one” list is just every possible property type it would have accepted, so it’s not telling you the field is genuinely missing.

Your errors are pointing at Problème and Adresse de l’intervention. Your Problème value is a nested switch(), and if there is no match (whether it be a different formSlug, or a type_probleme value that you didn’t account for) it will likely return empty. Add a default as the last switch() argument, or wrap it in ifempty().

Also check to make sure that the Value Type on each item matches the Notion property type. Adresse de l’intervention looks more like a Place property which means it needs lat/lng and not plain text.

Run it once and expand the module’s input bundle to see which Fields items are empty.

Well, finally, I’m using the Make An API Call module

Glad the Make an API call module got you unblocked. In case you (or anyone else) want to go back to the native module, to add to Anthony’s answer: Notion rejects the whole item if a title property comes through empty, so give the title field a fallback, like ifempty(<your switch()>; “Not classified”). A quick way to debug is to put a Tools > Set multiple variables module just before the Notion module, map every value into it, and run once. You’ll see exactly which one is blank for that form submission. For the address, if it’s a Place property in Notion, either change it to a Text property or send it the structure Notion expects instead of a plain string.