In ODK-CENTRAL with the version 1.2 is possible to make a comments about the info of the record, It's very usefull, but If I need a xls (or csv or txt) with all comments of the surveys, in which section can obtain all the comments of the intervies. It's this possible?
Thanks a lot!
2. What app or server are you using and on what device and operating system? Include version numbers.
ODK v 1.2 in droplet with Digital Ocean
3. What you have you tried to fix the problem?
I search the option for download all the comments with out lucky!
4. What steps can we take to reproduce the problem?
Navigate in the options of admin access
5. Anything else we should know or have? If you have a test form or screenshots or logs, attach below.
Hi,
I am trying to download comments using the API (i don't think it has been implemented in ruODK yet). I have tried using -
GET /v1/projects/{projectId}/forms/{xmlFormId}/submissions/{instanceId}/comments
GET /v1/projects/{projectId}/forms/{xmlFormId}/submissions/{instanceId}/comments/listing-comments
The first request does not return any comments associated with the submission.
The second Request returns a 404 Response. I noticed that the second one is not documented in the API docs - does that mean that it doesn't exist?
GET /v1/projects/{projectId}/forms/{xmlFormId}/submissions/{instanceId}/comments is the endpoint I expect. If you don't have any comments associated with the submission, I'd expect an empty response.
Make sure you have the correct project ID (it's a number) and the form ID (it's a string, not a number).
Here's a quick Python script using pyODK you can try.
from pyodk.client import Client
my_form_id = "favorite_colors"
my_project_id = 1
with Client() as client:
submissions = client.submissions.list(form_id=my_form_id)
for submission in submissions:
print(submission.instanceId)
comments = client.submissions.list_comments(form_id=my_form_id, project_id=my_project_id, instance_id=submission.instanceId)
for comment in comments:
print(" " + comment.body)
Here's the output I get.
uuid:fc44c3d9-ad41-44d6-9fbe-51ea46b13a00
Another comment!
Sally changed her name
uuid:6d6c46c6-0805-45e3-91dd-3474606668ca
uuid:67088acb-16ff-48c2-b8d0-0c8744edb172
uuid:9c1fdbc3-561a-4e5f-8fec-a36e7696c4d4
uuid:066f175e-c245-421d-b282-8664283003c3
I got older and started liking yellow 💛
uuid:cf1535ad-7f6c-4e54-bbda-60bfb4dea87c
uuid:d65b8be6-56f8-4e9c-90f0-f55dd6a365d9
@Florian_May Any chance for comments support in ruODK?
Ahhhh, thanks for the python alternative! (it confirms the output that I received from the Restful interface). So it seems I have a misunderstanding in what are "Comments".
I found a submission with Comments that worked. As you can see in the picture, the top comment was returned, but not the comment with "Has Issues". That implies that not all comments are equal!
Is it possible to retrieve the "Has Issues" comments? Happy for any python, restful alternatives
After a quick read of the pyODK docs, it seems there are comments associated with the "Review". I can see how you can add reviews, but there seems to be no method of listing reviews per submission.
You are missing something, and it's something I missed too! It's not a comment. It's a note that's associated with an action. So it's part of the server audit logs and associated with a submission.update. Hopefully that gets you pointed in the right direction.
This script below will get you those action notes. Unfortunately, it doesn't give you a way to associate it with an instance via the API because you just get the submissionID.
I'll speak with the Central team to see what improvements we can make, because the current behavior is not ideal.
from pyodk.client import Client
my_form_id = "favorite_colors"
my_project_id = 1
with Client() as client:
audits = client.get("audits", params={"action": "submission.update"}).json()
for audit in audits:
if audit['notes']:
print(audit['details']['submissionId'], audit['notes'])
@florian_may - while it has been illustrative to use python to problem solve, ruODK is my home ground. Do you think it would take long to implement comments?