Are ODK entities able to now work offline?

Are ODK entities able to now work offline?

As of Central v2024.3 and Collect v2024.3, you can use Entities offline.

2 Likes

Thanks for the response . So i have a form that i use to generate new IDS to participants. For every new participant, the previous ID is incremented by 1 to generate the new ID
The challenge i have is the calculation to generate this ID looks at an already uploaded excel to determine the previous assigned ID. I was thinking of using entities to update this uploaded excel in real time since in the field we usually work on 3 participants or more at a go .
can entities help with this?

Yes, Entity Lists should be a great fit for this! The general concept would be to look up some existing number like the biggest id assigned so far and add 1 to that.

I think you'll find this thread helpful: Generate sequential ID based on pulled data - #6 by LN

1 Like

Hello, thanks for the help on this . I have tried to implement this and yes the entities are being created however, the challenge is i want to update existing entities but not creating new ones.Below is a screenshot showing my entities and you can clearly see that it creates new ones other than updating existing entities. i have also uploaded my xls form


TRYD.xlsx (586.1 KB)

Hi @Terry_Ongaria,

In order to update entities, you need to change your form design. You could add another form so you have your existing form for creating entities and a new form for updating those entities.

Here is some more information on updating entities. Also check out the Entity Quick Reference.

If you want to see a form that both creates and updates entities, please check out this forum post.

1 Like

Hi @ktuite , thanks for the quick response on this . I have looked through the links and yes i have got some info on how to go about it , however, i am still facing challenges. Attached is my entity list that i uploaded to centra
idlist2.csv (113.1 KB)
l. I have two fields num and vno . I want the num column to be the only one updated hence i do not need creation of new entities . My first question is whether my entity list is ok?, do i need to add any new columns

This CSV can become an entity list with two properties num and vno_hno.

You also need another column in your CSV called label because every entity needs a label. I suggest just duplicating the vno_hno column OR using a dummy value that is the same for each row.

(The labels don't have to be unique. They are used for displaying entities in forms, but from what you've said about your form, you might not ever display it?)

Entities also have an Entity ID (also called name) but Central will generate an ID for every row when you upload the CSV. This is the ID you would need to work with in your form. You would select the entity based on the vno_hno value and then get the name of that entity. Then you should be able to just update the num property of that entity! This part of the Entity Quick Reference has an example: Looking up an Entity from an External CSV

If you share a sample form with me, I can try to help more.

Thanks @ktuite . I have gone ahead and added a label column ,since i am not particularly interested in it, i have just assigned it random values .
I think now the only challenge is working with the entity ID , i seem to be unable to reference it from my entities sheet, i would be grateful if you can assist on this particular step. Attached below is a copy of my form and the the new entity list. I have also attached another csv pinfo which isn't necessary for the entities but which you might need when uploading the main xlsx form.
Copy of ODK XLSForm Template.xlsx (586.1 KB)
Test1.csv (192.5 KB)
pinfo.csv (2.4 MB)