Can not pull formlist from custom server

Hi guys,

I am working on a custom server that sends form list repsponse upon /formlist request from ODK Collect v1.28.x.

When I select "get blank forms" from mobile (samsung android 10), the form list is returned but an exception at ODK collect is thrown saying that FormID is null ( this is noticed when I debug ODK Collect)

I assume that the response format between ODK Collect and my custom server is mismatched (as far as the FormID concern).

The expected format (per ODK Collect code inspect) seems as below:

{quote}
"

someId

"

{quote}

The fact that we have FormID at the same level with the formlist (instead of being an attribute of form) confuses me.

This issue, however, does not happen on v1.27.x.

Do we have any specification concerning response format defined anywhere ?
I use formList API (not xformlist) btw.

Thank you very much for your support.

In case this helps you, here is an example of a properly formatted /formList: https://ona.io/enketo/formList.

And here is the documentation: https://docs.getodk.org/openrosa-form-list/

3 Likes

Thanks for bringing this to the forum, @MyName -- it's generally the best place to start issue discussions to get greatest visibility.

The crash relates to formId not being specified in the response (https://github.com/getodk/collect/issues/4126). The best solution, as @martijnr describes, is to implement the supported and documented OpenRosa APIs.

Related issues on GitHub are https://github.com/getodk/collect/issues/4176 and https://github.com/getodk/collect/issues/4176. As I've mentioned there, another option for a quick fix would be to use the Collect code for the legacy API being implemented and see where the formId is expected.

If someone would like to propose a patch to make formId optional when using this legacy API, that could be included in Collect v1.29. However, we intend to entirely remove those legacy code paths within the next couple of releases.

Hi @LN,

As far as the patch concerns, I could work on it if you guys are ok with it. @LN, Could you please create a ticket for this and assign to me then ?
Thank you very much

As @LN points out, it is likely that the code paths supporting responses that don't conform to the Open Rosa standard will likely be removed at some point in the future. Given that, I'd like to nudge you once more towards returning Open Rosa responses from your custom server as an alternative to changes to Collect. The docs/spec for Open Rosa are here.

It's great that people are able to build custom servers but that is primarily enabled by having a spec that servers can conform to. I totally understand that there might be road blocks to you implementing the spec and that would also be interesting to discuss here.

1 Like

Agreed with @seadowg -- before we explore what a patch might entail, it would be very helpful to understand why that's your preference.

It was the (our) legacy server's code that is not conform with OpenRosa standard.
Since that will be no longer supported in the near future, I think I have to update our server to return Open Rosa reponses then.

1 Like

That sounds like the best long-term approach. Do let us know if you run into any issues doing that.

1 Like