Make reimporting a Ranked question from xlsform validate properly

Currently if you export a questionnaire with a ‘Rank’ question to xlsform and then re-import the questionnaire, it will split the question into multiple ‘Select One’ questions with some validation to attempt to stop list items being selected more than once.

However, the validation is not complete and only works if the user never goes backwards to re-rank.
In an example of a rank 3 items, the validation looks something like this:
Rank1 - No validation
Rank2 - rank2!=rank1
Rank3 - rank3!=rank2 AND rank3!=rank1

What happens when the user changes their mind mid-way through the ranking?
The validation no longer works!


  1. Work out a way to make Rank Question -> export -> xlsform -> import -> correctly interpret to a Rank Question
  2. Put proper validation on all Ranks so that every question is compared to every other ranked question.
    This does get long with a lot of ranks, but how else can it be properly validated?

I suspect this may be an issue with the export not adding the proper validations when exporting Rank Questions to xlsform.

Hi @Sceptre,

Is this what you are seeing while following the steps outlined below:

  • Create a ranking question in the form builder UI.
  • When you try to edit the question you see something like this:
  • Export your survey project to the xlsform (I tried with the following):
    Ranking Question Test 2020 09 02.xlsx (6.7 KB)
  • Then replace the existing form from the form builder UI with the xlsform that was downloaded previously.
  • You should see the following now (which is different them the screenshot captured before) while trying to edit survey project:

Is this the steps and the issue you are trying to report?

Have a great day!

Hi @Kal_Lam
Yes, that is part of what I am reporting.

The other issue is the validation conditions.

Using the form that you provided ( Ranking Question Test 2020 09 02.xlsx)
When you look at the validation conditions, this is what you see:

The first question doesn’t even have any validation.

Hi @Sceptre,

Kindly please be informed that the first choice does not have a constraint (does not require a constraint) even during the start (could you kindly verify it with xlsform that i shared or could you create one and test it out.

Have a great day!

Hi @Kal_Lam

If there is no validation, you can easily just do this:

All you have to do is select the third one first.
I know it will error at the end of the survey, but that could be hundreds of questions away.

However, if you have validation in all of the choices, like in the screenshot below, it will error as soon as the first duplicate choice is entered, regardless of which order they were selected.

Hi @Sceptre,

But why would the first choice require a constraint? The first choice should be able to choose any of the available option (isn’t it)? When it comes to the second and third options they definitely require a constraint as the first option should not be allowed for the second choice and the first and the second option should not be allowed for the third choice.

Have a great day!

When a person ranks items, it is pretty common to go back over them and re-rank them according to a changed mind.
In a ranking question, no choice should be the same as any other choice.

The current validation relies far too heavily on an interviewee only ever ranking first choice to last, on this singular user workflow.
Another example might be knowing what your top 3 choices are, but trying to decide the order.
You choose your 3rd rank first to reduce your options and then move up.
The validation doesn’t work in that case until the user submits the survey.

This is perhaps two separate issues -

  1. Rank questions not being recognised when exported to xlsform and imported
  2. Ranking validation relying too heavily on a top to bottom user flow
1 Like

Hi @Sceptre

Please note that if you export this form to XLSform, then the ranking questions need to still adhere to what has been discussed in the article below.

Unfortunately, this is what the system can currently offer. I would suggest that you create this as a recommendation for the future.


1 Like

What about an additional choice_filter for question 2 and 3, like name != selected(…)?