Download submission form

I am trying to download submission form, but i am getting the following error
HTTP Status 500 - top level group name: data is not as expected: my_test_form.xls

this is my url

https://sandbox.aggregate.opendatakit.org/view/downloadSubmission?formId=my_sample_odk[@version=null]/data[@key=uuidMyKey]

I got your form from https://sandbox.aggregate.opendatakit.org/www/formXml?formId=my_sample_odk&readable=true

Your root instance element name is a bit odd:

<?xml version="1.0"?>
<h:html xmlns="http://www.w3.org/2002/xforms" xmlns:ev="http://www.w3.org/2001/xml-events" xmlns:h="http://www.w3.org/1999/xhtml" xmlns:jr="http://openrosa.org/javarosa" xmlns:odk="http://www.opendatakit.org/xforms" xmlns:orx="http://openrosa.org/xforms" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<h:head>
    <!-- ODK Aggregate upload time: 2019-04-25T19:35:44.074Z on https://sandbox.aggregate.opendatakit.org -->
    <h:title>My Test ODK Form</h:title>
    <model>
        <instance>
            <my_test_form.xls id="my_sample_odk">
                <start/>
                <end/>
                <today/>
                <deviceid/>
                <subscriberid/>
                <simserial/>
                <phonenumber>9999999999</phonenumber>
                ...
                <meta>
                    <instanceID/>
                </meta>
            </my_test_form.xls>
        </instance>

ie

<my_test_form.xls id="my_sample_odk">...</my_test_form.xls>

Normally this is either or the original XLSForm filename sans suffix. Although periods are supposed to be allowed in XML element names, its atypical, and usually avoided (and I dont know if Aggregate/ODK et al handles them...).

Hi @Xiphware thank you for the reply.

This is my test file and I have been playing with ODK for only 2 days so sorry if I am a bit unclear.

Oh so in my tag name my_test_form.xml I should not have .xml part?

will that be a part of the problem? Because what I need to achieve is to get a submitted form using a uuid key or to get them all at ones by passing in the form id. Is that possible?

Also here is how my form looks like

I'm not sure how the ".xls" file suffix ended up in your root instance element name - normally it would stripped off as part of the pyxform conversion. So I might suggest pushing your XLS form thru https://opendatakit.org/xlsform/, and uploading the resulting XML into Aggregate and using that (just to be clear on what tools you are using).

Aggregate provides APIs for retreiving form submissions, documented here: https://docs.opendatakit.org/briefcase-api/

Basically, you would first call view/submissionList to get the ids of all the submissions, then you'd issue a view/downloadSubmission against whatever submission(s) you want. Which is to say, there is no 'get them all at once' API - you'd have to get the list, then fetch each one in turn.

Right, so the process that I have is to create the xml file first, that I push it throw https://opendatakit.org/xlsform/ where I download the xml file and save it in the ODK Aggregate sandbox website. When I navigate to that file from my ODK Collector, I am able to see my form and able to submit it with my data.

Yea that's what I was thinking to do. Is to create a list of all ids using the submissionList endpoint then loop it throw and pass it into downloadSubmission endpoint. My concern it putting a lot of requests into ODK Aggregate API.

Not sure what I am doing wrong.

Hey @Xiphware Thanks for your help btw!

Also I was able to solve my problem with /view/downloadSubmission URL. In the documentation is mentioning to use /data in the GET method. But when I replaced it that with my fileName, it worked like a charm.

Here is a below example:

Not working:
https://sandbox.aggregate.opendatakit.org/view/downloadSubmission?formId=my_sample_odk[@version=null%20and%20uiVersion=null]/data[@key=uuid:ade019de-fda6-450e-b6da-d5ae8a46eaee]

Working:
https://sandbox.aggregate.opendatakit.org/view/downloadSubmission?formId=my_sample_odk[@version=null%20and%20uiVersion=null]/my_test_form[@key=uuid:ade019de-fda6-450e-b6da-d5ae8a46eaee]

Glad its working for you now. I'd still suggest getting rid of that <my_test_form.xls> root instance element name. Not sure how the ".xls" got in there, but it is rather unusual and could potentially 'break' all sorts of other things/tools downstream... This root instance element is used as the 'anchor' to lookup the specific value of submission questions, so it ends up gets parsed all over the place.

Hello Alex4, i also faced the same issue but then got resolved.
Is there any way to fetch all the UUID records simultaneously from ODK Aggregate without passing individual UUIDs ??

Like fetching all records instantly at a go ??
please suggest thanks!!