Here's the form Hélène, the entities (ouvrages_inventories.csv), the rejected submission with error (Required parameter uuid missing.) and a needed csv file -unites_hydrauliques.csv)
ouvrages_hydrauliques.xlsx (472,5 Ko)
ouvrages_inventories.csv (268,7 Ko)
uuid_6e5a5474-b9d4-4418-8700-0dac84425609.xml (1,9 Ko)
unites_hydrauliques.csv (1,2 Ko)
Maybe there are some unneeded not working tries (calculates) but with no impact I think on the issue.
I updated both form definition and submission as the error occurs without the repeat.
It looks like there is no Entity id generated when the create_if condition is true. On the Entities sheet, the entity_id is set to ${ouvrage_suivi}. That's an Entity selection field with a relevance condition of ${action} = 'suivi' or ${action} = 'modification'.
You might think there's a fallback to a UUID in case the entity_id value is blank but that's not currently the case -- you're responsible for making sure that the entity_id reference is always set in the way you want it.
In your case, you can change the entity_id expression to coalesce(${ouvrage_suivi}, uuid()). This uses ${ouvrage_suivi} if it has a value or generates a new uuid otherwise. Another way to write the same thing is if(${ouvrage_suivi} != '', ${ouvrage_suivi}, uuid()).
We have the following docs on this:
Maybe we should add a troubleshooting section that specifically calls this out? It's not very intuitive so I'd love any suggestions you have for improvement. I do think it's probably something Collect should detect and at least warn about as well.
Thanks Hélène !
I misunderstood the usage of the entity_id column of the entities sheet. I thought it was only used for entities updates, not that it was used to set the id of a new one, as this column is not needed for entity creation.
I'll try it as soon as I'll be back tonthe office.
I also had this slightly wrong in my head until I tried to create a form that would mix multiple lists where some were create only and some were create/update.
Now I know to leave entity_id create_if update_if blank for those that only create, but must populate them all correctly for create&update.
I also wiped out some entity item fields during testing for a create/update case, as I incorrectly set relevance on both the group containing the save_to values and the individual fields within - as I understand it now, only if I make the group relevant, will an entity create/update, and within this, depending on which fields are also relevant, certain values will get created or updated.
As an example - a form that can do the following two actions needs the save_to group relevant for both as create = yes OR clarify = yes but then also has to make the various save_to fields relevant as create = yes for some and clarify = yes for one.
- submit a new item: will create an entity and populates a number of fields for it
- view an existing item and optionally submit a clarification: will lookup an entity but optionally update only one field for it
Thanks a lot @LN, everything works fine now !