Closed jamiewhths closed 7 months ago
Did the demo db in the Introduction vignette change? It seems like it has a duplicate column now "Monthly reports" (also a sub-form). To fix the build checks, I will need to address this issue now in 4.36.
records <- getRecords("ceam1x8kq6ikcujg") |> collect()
https://www.activityinfo.org/support/templates/3w.html
This is addressed in 4.36
From @Ryo-N7:
When using the getRecords() + collect() workflow to grab data from forms, there is an error when there are duplicate field labels in a form (example: https://www.activityinfo.org/app#form/c6ipg3tldcxr80y2/table).
Previously with queryTable() this wasn't a problem because it had its own methods to automatically convert duplicated field names as shown in the above example.
Also this is only a problem when using prettyColumn and minimalColumn style because the defaults here creates the returned output with field labels whereas allColumn style uses the field code first before trying field labels if they don't exist. If you do a traceback, the error is coming from collect() where the function is trying to structure the data back into a tibble/data.frame. Since there is no default set on how to handle duplicate column names (like in queryTable), this causes the function to simply throw an error and not return anything which can be frustrating as then we have to go into the form and manually edit the field name to get it to work.
The most likely solution is to specify the .name_repair somewhere with a default like how queryTable handles it.