Problem Validatlon rules expression for radio button

Hello,

I tried to create a simple radio button group with an validatlon rules based on an expression.

I have this radio button module, question name “question1” with:

Value

  • Item 1
  • Item 2
  • Item 3

With this expression, made using the interface
Validation rules → Expression → Validation expression → {question1} = ‘Item 2’

When I test it, I always have this feedback The expression: “{question1} = ‘Item 2’ should return ‘true’.”

it runs online, and the json code is:

{
  "title": "testRadio",
  "pages": [
    {
      "name": "page1",
      "elements": [
        {
          "type": "radiogroup",
          "name": "question1",
          "title": "Test",
          "validators": [
            {
              "type": "expression",
              "expression": "{question1} = ’Item 2’"
            }
          ],
          "choices": [
            "Item 1",
            "Item 2",
            "Item 3"
          ]
        }
      ]
    },
    {
      "name": "page2",
      "elements": [
        {
          "type": "html",
          "name": "question2",
          "html": "OK!"
        }
      ]
    }
  ],
  "clearInvisibleValues": "none"
}

Any idea why it does not work? I use the same process in previous questionnaires and it was working well.

Thanks for your feedbacks !

Check the column name in the data file. I’ve just replicated and then fixed your issue in my own test by editing my expression from {question10} = 'Item 2' to {block_1/question10} = 'Item 2'

Perfect! it works well, thank you :slight_smile: