Skip to content

Form field labels which include double quote characters " cause an error when using dplyr::collect #154

@jamiewhths

Description

@jamiewhths

Form field labels which include a double quote character " will cause an error when collecting into a dataframe:

records <- getRecords("c123") |> collect()
Image

This seems to be caused by a JSON serialisation/deserialisation step that does not escape the quotes correctly when computing dataframe column headers.

This is not due to the server response, as the form schema query correctly escapes the field labels in the returned JSON:

{
  "id": "cxyx2t6mdelrfwr6",
  "code": "yn",
  "label": "\"Yes / No\"",
  "description": null,
  "relevanceCondition": "",
  "validationCondition": "",
  "required": false,
  "type": "enumerated",
  "typeParameters": {
  "cardinality": "single",
  "presentation": "automatic",
  "values": [
    {
      "id": "cgex1hkmdelrfwr5",
      "label": ""
    },
    {
      "id": "cjj2lefmdelrlx57",
      "label": "Non"
    }
  ]
}

Workaround

Two workarounds currently identified:

  • Update the columnStyle to use codes for header labels, and update form design to add field codes where labels include ":
records <- getRecords("c123", style=columnStyle(columnNames=c("code", "label"))) |> collect()
  • Update the form design to remove " from any field labels

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions