Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

Excel Builder for LimeSurvey Survey Authoring

More
2 weeks 6 days ago #273916 by nickulet
Hi everyone,

I wanted to share a small open source project I've been working on that some of you might find useful: LimeSurvey Excel Builder.

The idea: Design your entire LimeSurvey questionnaire in Excel (or LibreOffice Calc), then convert it to the TSV import format with an R script. You can also skip the R installation entirely and use the free web app: just upload your .xlsx and download the ready to import .txt file.

🔗 GitHub: [url] github.com/stf-lab/limesurvey-excel-builder [/url]
🌐 Web app (no install needed): [url] limesurvey-excel-builder.shinypal.com [/url]

Why I built this

I work in international health and we regularly design large multilingual surveys (think questionnaires with 100+ question groups, 4+ languages, lots of skip logic). Doing all of that in the LimeSurvey web interface is slow, and collaborating with colleagues on survey design and tracking changes, reviewing questions, doing batch edits is painful through the UI alone.

With this tool, you get:

Rich text formatting from Excel: bold, italic, underline, font color on any word or phrase in a cell, and it all carries over to the survey as proper HTML. Partial formatting within a cell works too (e.g. only one word bolded).

Multi language via columns, not duplicated rows: just add text_fr, text_es, text_ro, etc. columns next to your base language. The script auto detects languages, generates all the TSV rows LimeSurvey expects, and handles fallback for untranslated cells.

Familiar spreadsheet workflow: find/replace, copy paste question groups between surveys, reorder with drag and drop, use filters, work offline.

Version control: the .xlsx plays nicely with Git for tracking survey revisions across team members.

Validation: the R script checks for duplicate codes, invalid class values, underscores in question codes, and reports what it found before export.
What's in the repo
An Excel template (limesurvey_survey_builder.xlsx) with color coded rows, dropdown validation, 41 advanced attribute columns, 4 reference sheets (question types, relevance/validation, survey settings, instructions), and a full example survey covering 30+ question types.

An R script (xlsx_to_limesurvey_tsv.R) that reads the Excel file and produces a .txt file you can import directly into LimeSurvey (Create Survey → Import).

The template uses a simple row based structure: S (survey settings), SL (survey language text), G (groups), Q (questions), SQ (subquestions), A (answers). Row order matters, but the color coding and reference sheets make it pretty intuitive.
The example survey
The included example has 6 question groups, 41 questions, and demonstrates: single/multiple choice, arrays, numeric input, text, date, file upload, ranking, dual scale, equations, boilerplate text, skip logic, regex validation, calculated fields (e.g. BMI from height and weight), array filtering, and a tailored closing message using expression logic: all in English, French, Romanian, and Spanish.
How to use it
Option A: Web app: Go to the web app link above, upload your .xlsx, download the .txt, import into LimeSurvey. Done.
Option B: R script: Open the Excel template, design your survey, run the R script in RStudio. It auto installs the needed packages (readxl, tidyxl, xml2) on first run.
Looking for feedback
This has been working well for my own projects, but I'd love to hear from others:
  • Are there question types or features you'd want better covered in the template?
  • Any edge cases with the import that I should handle?
  • Would additional language examples be helpful?

Contributions are welcome: it's MIT licensed. Feel free to open issues or PRs on GitHub.

Hope this is useful to some of you!
The following user(s) said Thank You: DenisChenu, tpartner, Kylie.zen

Please Log in to join the conversation.

More
2 weeks 6 days ago #273919 by Kylie.zen
This is an incredible resource! As a student in Brooklyn currently diving deep into data analytics and systems modeling. I can’t emphasize enough how much calculated fields and expression logic simplify a user’s experience.

​I’ve been working on similar logic for my own academic projects. Last semester, my friend Andriana Joseph, who is a genius with spreadsheets, suggested I stop doing manual calculations for my GPA and graduation timeline. Following her advice, I started using the grade and graduation calculators.

Seeing how you’ve integrated things like BMI formulas into LimeSurvey is very inspiring. It’s exactly the kind of automation students and researchers need to save time.

Kylie jen

Please Log in to join the conversation.

More
2 weeks 4 days ago #273924 by DenisChenu
Really great tool !
Thank you for sharing with a FREE licence !

Version control: the .xlsx plays nicely with Git for tracking survey revisions across team members.


 
You cannot see the difference in github , right ?
Maybe in git directly it's better (but it's still zip file) ? Are there some tools to see difference ?
(Possibly I try to fork it as ods ;) )
 

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member. - Professional support - Plugins, theme and development .
I don't answer to private message.

Please Log in to join the conversation.

More
2 weeks 3 days ago #273925 by nickulet
Good point. You are right that Git can't show line-by-line diffs for .xlsx since it's a binary format. What I meant is more about tracking versions (who changed what, when, being able to roll back) rather than seeing granular diffs. For reviewing actual changes between survey versions, I usually compare the exported .txt files which are plain TSV and diff perfectly in Git.

Please Log in to join the conversation.

More
20 hours 37 minutes ago #274042 by tammo
I played with it and I am very enthousiastic!

Some improvements possible:
  • the rich text formatting works great, but it works against you when you want to do this on settings: like the automatically converted by (Libre Office Calc) email address, which was transformed to some HTML with color code, while this was not necessary and resulted in an import error. You could also define a column for survey settings, not using the first text_language column.
  • I find the language fields combination too complex (or maybe I just do not understand the logic behind it): either just follow the settings with prescribed language and additional languages (ijn the variables "language" and "addtional languages" and use these (when there are corresponding language columns, while leaving away the language columns that are not prescribed), or just use the language columns, assuming that the first language column represents the default language. In that last case you can leave away the language setting and the setting for additional languages.
My 2 cents,

Tammo
 


Tammo ter Hark at Respondage
For Limesurvey reporting, education and customized themes
respondage.nl

Please Log in to join the conversation.

More
18 hours 56 minutes ago #274043 by nickulet
Hi Tammo,

Thank you so much for taking the time to test this and share such detailed feedback -- really appreciated!

Both improvements are now implemented and committed to GitHub.

1. Rich text formatting on settings rows

You were right. The script was applying HTML conversion to all rows including S (settings) rows, which caused problems when LibreOffice auto-formats email addresses as blue underlined hyperlinks. The fix is in place: HTML conversion is now skipped entirely for S rows, which are always treated as plain text. As a bonus, the script now emits a warning if it detects that an S row cell has rich text formatting, naming the setting and column:
Code:
WARNING: Rich text formatting on S row (name='adminemail', col=text_en) -- ignored. Check for auto-formatted hyperlinks in LibreOffice.

This applies to both the R script and the Shiny web app new location:  limesurvey-excel-builder.60.md

2. Language field logic

Also fixed. The script now uses the columns-driven approach you suggested: the first text_xx column determines the default language, and the remaining text_xx columns (in left-to-right order) become the additional languages. The language and additional_languages S rows are auto-populated from this detection on each run, so they no longer need to be maintained manually in the Excel sheet. The Excel template and instructions have been updated to reflect this.

If you run into anything else, please do share.

Best regards,
nickulet

Please Log in to join the conversation.

Moderators: tpartnerholch

Lime-years ahead

Online-surveys for every purse and purpose