Assign forms to groups ODK Survey

1. What is the problem? Be very detailed.
How to assign forms to different groups in odkx odkx-survey + odkx sync endpoint

2. What app or server are you using and on what device and operating system? Include version numbers.
The APP server is odkx sync endpoint and the survey is carried out on tablet devices with odkx survey installed on

3. What you have you tried to fix the problem?
I have tried Permissions and Filters in odk-x documentation but couldn’t take much from it.

Permissions and filters is the right material but definitely a lot to take in! If it helps to have a good example, the cold chain demo here: has a nice example of different groups. You do have to set up the different groups in the sync-endpoint, then have users log in who are assigned to those groups on the tablet. Then you can make sure the right person gets the forms, either from the administrator end, or with someone with a higher level of permissions (e.g. a supervisor) reassigning data in the field.

1 Like

Hi @elmps2018! I checked out the cold chain app structure to understand how I could create a level access for different forms, groups, and users.

  • I’ve created a tableId .csv (1.0 KB) and tables.init (66 Bytes) files under config/assets.

  • Also I’ve created a new user and a specific group to fit the definitions about level-access in the .csv. So, a new user called senado9 and a new group named Senado.

  • The final step would be send the files to a device and then execute a Reset App Server command. But after sent it to device, I got a crash error when trying to open ODK Survey app. There’re not any error during all the process (convert XLSX, framework, adbpush). Btw the form works fine without the assets .csv and tables.init. I’ve used these files to create the form: Senado9.xlsx (19.7 KB) and state_city.csv (132.2 KB).

Any hint about what’s causing the crash of ODK Survey app? And whether there are any misleading structure in the finals I’ve setted up.

Sounds like the issue is in the preloaded data more than the permissions. I often have issues with preloading data when I have something in the table that is supposed to preload that’s incompatible with the underlying table. Can you try a version without tables.init. If you open tables and it seems fine then try importing the csv through tables. If that hangs or crashes, it’s likely that something in the tables database doesn’t line up with the form. Exporting an empty csv with the right header from tables can help with this; but sometimes the issue is in the contents of the csv, for example having a string in an integer.

1 Like

That was the problem in fact. The .csv had a different order in the column names.

I have synced the table with GROUPS information to endpoint server. I was expecting that only users within the certain group would be able to see the form and collect answers consequently. But I got the following behaviour:

  • The user aleite outside the GROUP_SENADO was able to see the form in the ODK-X Survey and collect new responses as described below. That user was not able to see the row that already exists in the table.

My desired state with this row-level access would be give visibility and ability to collect responses only to the users within a certain group. Am I missing anything?

The aleiteuser belongs to default_prefix synchronize_tables. And the SENADO group is set as default_senado.

1 Like

Glad one problem solved! It looks like the savepoint creator was anonymous. It also looks like your form does not have a properties tab. You’ll want to add one and lock the table so that anonymous/unverified users cannot create tables. See details here under Table-level Security Configuration:

Had you made anonymous have these permissions/group? Or had you logged in as anonymous? Otherwise there may be some issue with the ODK-X services login that is also contributing.