Update only handlebars file

Hi,

We have setup the ODK sync endpoint server and uploaded the forms to it, however we may regularly update forms and forms related files.

For instance, we have brought some updates in the handlebars file of a forms and now want to upload only the updated handlebars file to the server, how am I gonna do that?

I have tried uploading it through suitcase but to no avail.

thanks,
Mirwais

I am not sure how/if you can update the handlebars files, but one option if you want to update forms mid-fielding you can download all your data, pre-load it into the revised forms, reset the app server, and push the revised version back up (new handlebars and all). This ensures that fields are compatible, etc., with already existing data. I would make very sure to back everything up and find a time when no one would be syncing before trying this! Another option is to simply create a new version of the app/forms, e.g. if you had β€œdefault” app you can create β€œv2” app that has the new version and have people switch to that – it depends a lot on your workflow and if you need to keep accessing data in v2.

Suitcase has the ability to do that.

You should be able to update your file using the upload tab in Suitcase. In that tab choose where you data is and then hit upload. The directory chosen must follow the ODK-X directory convention,

<NAME>
β”œβ”€β”€ assets
β”‚   └── ...
└── tables
    └── example
        β”œβ”€β”€ forms
        β”‚   └── example
        β”‚       └── ...
        └── ...

You would point Suitcase to <name>.
Only the files you want to update need to be present but the directory structure needs to be complete.

It is also possible to use the CLI, check the CLI usage for more information.

1 Like

Thank you, tested it and worked like a charm but worth to mention that along the directory structure I guess we must keep the definition.csv file as well.

I tried it with only my desired file and it was giving error but when I added that definition.csv file it got uploaded.

A post was split to a new topic: Preload data ODK-X

Is it also possible to update the formDef.json file using the same method, at least when there are no database schema changes? I actually tried doing this and I see an β€˜uploading’ message followed by an β€œError Occured” dialog box. Has anyone tried this?

I have tried that, but make sure you are a site_admin privilege level. Also you need to make the folder schema correctly match. Simply pointing out the formDef.json file won’t work you need to put it in a folder <target folder>/config/tables/<table id>/forms/<survey id>/formDef.json

I haven’t tried it with the new UI however, but the underlying code is the same as it uses sync-client.

1 Like

Thanks, I tried just that, but I am still unable to do this. I tried using CLI and this is the error I get -
Error: Unable to reach Cloud Endpoint server.
javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

The error refers to some SSL related issue but I am not sure what exactly. Can you help? Thanks.

BTW, I am able to use the GUI to sync the whole setup and also download data from the server. Only when I try to upload files, I get the error.

1 Like

Hmmm…

We will have to look it into. Thank you for alerting us. I have created an issue:

1 Like