Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Triggers referencing question names with dot not working #2420

Closed
dasboe opened this issue Sep 29, 2020 · 4 comments
Closed

Triggers referencing question names with dot not working #2420

dasboe opened this issue Sep 29, 2020 · 4 comments
Assignees
Labels
Milestone

Comments

@dasboe
Copy link

dasboe commented Sep 29, 2020

Are you requesting a feature, reporting a bug or asking a question?

bug

What is the current behavior?

When using a dot in a question name triggers do not work

What is the expected behavior?

Triggers work with dots in question name

How would you reproduce the current behavior (if this is a bug)?

Create a question with a dot in question name. Use a trigger with this question name.

Provide the test code and the tested page URL (if applicable)

Test code

{
 "pages": [
  {
   "name": "page1",
   "elements": [
    {
     "type": "dropdown",
     "name": "question1",
     "choices": [
      "item1",
      "item2",
      "item3",
      "item4"
     ]
    },
    {
     "type": "text",
     "name": "question.name2"
    }
   ]
  }
 ],
 "triggers": [
  {
   "type": "setvalue",
   "expression": "{question1} anyof ['item1', 'item2']",
   "setToName": "question.name2",
   "setValue": "one"
  },
  {
   "type": "setvalue",
   "expression": "{question1} anyof ['item3', 'item4']",
   "setToName": "question.name2",
   "setValue": "two"
  }
 ]
}

Specify your

  • browser: Chrome
  • browser version: 85.0.4183.102
  • surveyjs platform (angular or react or jquery or knockout or vue): vue
  • survey-vue version: 1.8.5
@andrewtelnov
Copy link
Member

@dasboe I have fixed the issue by commit above.

Thank you,
Andrew

@dasboe
Copy link
Author

dasboe commented Sep 30, 2020

Great - thanks so much for the quick fix Andrew!
Björn

@dasboe
Copy link
Author

dasboe commented Jan 4, 2021

There is still an issue with dots in triggers. A slightly different example to the above is not working correctly:

{
 "pages": [
  {
   "name": "page1",
   "elements": [
    {
     "type": "dropdown",
     "name": "question.name1",
     "choices": [
      "item1",
      "item2",
      "item3",
      "item4"
     ]
    },
    {
     "type": "text",
     "name": "question.name2"
    }
   ]
  }
 ],
 "triggers": [
  {
   "type": "setvalue",
   "expression": "{question.name1} anyof ['item1', 'item2']",
   "setToName": "question.name2",
   "setValue": "one"
  },
  {
   "type": "setvalue",
   "expression": "{question.name1} anyof ['item3', 'item4']",
   "setToName": "question.name2",
   "setValue": "two"
  }
 ]
}

@andrewtelnov
Copy link
Member

@dasboe I have created the separate issue.

Thank you,
Andrew

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants