Is there any endpoint from which I can retrieve the form fields labels

I'm currently working with the ODK API, specifically the endpoint /projects/{projectId}/forms/{xmlFormId}/fields,
to retrieve form fields. While this endpoint provides valuable information, I've encountered an issue regarding the absence of form labels in the response.

Names of the fields might not always accurately represent their intended purpose, whereas labels provide user-friendly descriptors visible during form filling

I'm curious if there are any additional parameters that can be passed to the existing endpoint or if there exists an alternative endpoint specifically designed for fetching both form fields and their corresponding labels.

Hi Niraj,

There isn't any endpoint that gives label of the fields. Only way to get the labels is to retrieve the XML of the form and parse it manually - not an easy task though.

1 Like

It feels like we should make this easier, no? Provide some way to get a data dictionary programmatically?

I know others (like @chrissyhroberts) are interested in this data dictionary idea!

We don't parse the labels and store them separately in Central (because they can change as form versions change, and it's mostly other parts of an ODK pipeline like Collect, Enketo, and pyxform that need to work with labels) but it would be possible to add something to Central to have it re-parse a form on the fly in order to return labels with form fields.

Its probably worth noting that these labels can potentially contain (multiple) paths to the instance XML, to display the current value of other things in the label. So the raw uninterpreted label string could get quite ugly... Although in many cases the label is a user-friendly static string :+1: