1. What is the issue? Please be detailed.
Most of this is fodder for future searches / kapa.ai, but there is one part of the docs that appears incorrect?
The quick reference says (emphasis mine)
When updating an Entity, the value in the entity_id column is required and must be the Entity's system ID. This generally means that you need to attach an Entity List in order to update its Entities. See the using Entity data section.
But attempting to upload a form setup to update without a select from the list will not validate:
The XLSForm could not be converted: ODK Validate Errors:
>> Something broke the parser.
Error evaluating field 'trunkVersion' (${meta}[1]/entity[1]/@trunkVersion): The problem was located in Calculate expression for ${entity}/@trunkVersion
XPath evaluation: Instance referenced by instance(testmultiplelist)/root/item/__trunkVersion does not exist
Caused by: org.javarosa.xpath.XPathMissingInstanceException: The problem was located in Calculate expression for ${entity}/@trunkVersion
XPath evaluation: Instance referenced by instance(test_update_entity)/root/item/__trunkVersion does not exist
... 10 more
The following files failed validation:
${tmpn7kgoa6m}
Result: Invalid
For the case of updating an entity (would also apply to create or update form for update usage), and the very strange method of getting the system ID not by selecting an entity item (either entering the system ID, or looking it up from a column in a different list etc)- the docs indicate you don't have to attach an entity list, but in practice you can't upload the form this way.
The only workflow I can currently imagine (as typing in a UUID is madness) that wouldn't refer to the entity list for the update case is barcodes/QRcodes containing the system ID that are scanned and this value is then used for entity_id. Even then, why you would not attach the list to validate the scan as an existing item (privacy concerns not wanting the user to have access to the entity list contents?) is making this example pretty far fetched.
The fix is to change the language from "This generally means that you need to" to "This means that you must", unless there is a valid use case for updating without access to the list - then the parser needs to be modified.
tl;dr
While testing repeat-entities I first created a fresh form to create an entity but kept getting errors. I switched to a known working entity form to continue and came back to try to find out what was wrong.
My fresh form returned this error
The XLSForm could not be converted: ODK Validate Errors:
>> Something broke the parser.
Error evaluating field 'baseVersion' (${meta}[1]/entity[1]/@baseVersion): The problem was located in Calculate expression for ${entity}/@baseVersion
XPath evaluation: Instance referenced by instance(colours)/root/item/__version does not exist
Caused by: org.javarosa.xpath.XPathMissingInstanceException: The problem was located in Calculate expression for ${entity}/@baseVersion
XPath evaluation: Instance referenced by instance(colours)/root/item/__version does not exist
... 10 more
The following files failed validation:
${tmpf80akn03}
Result: Invalid
The reason appears to be:
- You cannot include create_if/update_if/entity_id on the entities sheet without including the entity list in the form via a select
- For create or update, you must have all columns on the entities worksheet, you can't simply remove update_if to make it a create form
- If you want to only create entities without reference to the entity list, you must remove create_if/update_if/entity_id and only use list_name/label.
- If you only want to update use list_name/label/entity_id, but contrary to the docs note, you must also include the entity list in the form
3. What have you tried to fix the issue?
- I removed the repeat column from the entities sheet and the repeat from the form - no change
- Adding
select_one_from_file listname.csvallowed the form to upload, but doesn't solve the case of creating without referencing the list. - Without the select, I removed the update_if column from the entities sheet but left create_if & entity_id, but this isn't valid
The XLSForm could not be converted: The entities sheet can't specify an entity creation condition and an entity_id without also including an update condition.
- I checked the docs as I was sure there was an example of creating without selecting (there is), and it doesn't have create_if / update_if or entity_id on the entities sheet, so I removed them all only leaving list_name and label - this worked.
- Re-reading the quick reference does detail this and shows the columns needed for create / update / create or update