<! ODK Entity Challenges in Outage Reporting – Looking for Solutions
Greetings everyone, my name is Onyali Forbes, I work with the electric utility company in Guyana. Ive been working on improving our outage reporting process using ODK. I was able to build a form and upload it successfully to Central, and I even created the entities dataset with all the properties linked to the form. However, when I fill out the form, the details don’t actually get saved into the entities dataset, even though everything looks connected.
My main goal is to have one form that can either create a new outage or update an existing one. I’ve tried designing it so the user first selects whether they want to create or update, but making sure only the right fields and entity actions run has been tricky. If both workflows trigger, I get errors with missing UUIDs or invalid entity references.
So I’m reaching out for advice. Should I keep the create and update process in one form with strict relevant conditions, or would it be more reliable to separate them into two forms? And when updating, is it better to show old answers as read-only notes, or have them pre-filled in editable fields? I’d really appreciate any insights that could help make this outage reporting process smoother and more reliable.
Welcome to ODK Forum, if you have a moment, feel free to introduce yourself here
I looked into your form and found a couple of issues:
For the entity ID, we need to use once(uuid()). It cannot be concatenated with any text—it must strictly be in UUID format.
In the entities sheet, the expressions for entity_id, create_if, and update_if currently have a space between the single quotes. These should be empty strings, i.e., ''.
Thank you, this was useful. Is there a way to manage the submissions? Like, if a submission was updated, will it remain as a search on the entities list?
Yes, updating Submission will not have any impact on the Entity List as both have separate lifecycle. When Submission is submitted it can create or update an Entity but editing a submission will not change entity in any case.
When trying to update the form using ODK Collect, I select a record to update, click next, and this error message pops up, then it goes straight to the Remarks question (skipping questions like Time in and Reason for outage). When creating, I can answer the questions from Date to Category, skipping Time in and Reasons as well and going straight to remarks.
Hi @OForbes! It looks like there might be a bug in Collect when using time values from an entity as a default value like you’re doing in the update_time_out question. We’re investigating and should hopefully have a fix soon.
For now, I think your form should work if you omit that question. Alternatively, you could work around the problem by replacing it with a two question “optional update” pattern: ta select_one asks “the timeout values was <time_out>. Is that correct?” with yes/no options followed by a time question that is only shown if they answer “no” to the first one.
Besides what Callum suggested, you can circumvent this problem by including date in the calculation of update_time_out like this: concat(instance('updateoutages')/root/item[name =${followup_outages}]/date,"T",instance('updateoutages')/root/item[name =${followup_outages}]/time_out)
Greetings, both are excellent recommendations. I added a few fields to address the time_out issue, and it works. Thank you. Please see a snippet of what I did.