Welcome to the LimeSurvey Community Forum

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

Array Text, field validation, only one column

  • tassoman
  • tassoman's Avatar Topic Author
  • Offline
  • Premium Member
  • Premium Member
More
2 years 8 months ago #218659 by tassoman
Hello there, looking for documentation I've found how to validate each field of an Array Question Text.

Using
Code:
this.NAOK == 'A' OR this.NAOK == 'B'
as SubQuestion validation, I can check every single field inside the array.
But what if I want to validate only one cloumn of SubQuestion?

For example, is it possible to refer to column, such as a Q12_SQ*_SQemail ? Where SQemail is the Y-axis of the column

«All your survey answers are belong to us »
The topic has been locked.
  • tassoman
  • tassoman's Avatar Topic Author
  • Offline
  • Premium Member
  • Premium Member
More
2 years 2 months ago - 2 years 2 months ago #224840 by tassoman
Replied by tassoman on topic Array Text, field validation, only one column
I've just discovered I can refer as self.sq_Colname to loop in y direction.
But writing this as condition: ! is_empty(self.sq_Colname)
Gives me an error in ExpressionSyntax, because I get ! is_empty(Qu.Row1.Colname, Qu.Row2.Colname, Qu.Row3.Colname) as final condition

«All your survey answers are belong to us »
Last edit: 2 years 2 months ago by tassoman.
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Away
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
2 years 2 months ago #224844 by Joffm
Hi,
I am surprised that nobody answered your initial post.
This is the standard usage of "self" and "that".

But you are right. This only works in functions like "count" or "sum" that take a list of questions as parameter, as you may read in the manual (implemented functions).
"is_empty" expects only one parameter. Therefore you can't use it here.

Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The topic has been locked.
  • tassoman
  • tassoman's Avatar Topic Author
  • Offline
  • Premium Member
  • Premium Member
More
2 years 2 months ago #224861 by tassoman
Replied by tassoman on topic Array Text, field validation, only one column
Thank you Joffm for your kind reply (^^)/
I managed it by using self.sq_Colname ne "" and it does validation for each field in the column. The problem is I have subquestion rows relevace activated but it's still trying to validate hidden rows also, such as the whole array's rows are shown

«All your survey answers are belong to us »
The following user(s) said Thank You: DenisChenu
The topic has been locked.
  • tassoman
  • tassoman's Avatar Topic Author
  • Offline
  • Premium Member
  • Premium Member
More
2 years 2 months ago #224867 by tassoman
Replied by tassoman on topic Array Text, field validation, only one column
I've solved adding a previous question (number, or range 1-5) indicating how many rows are expected.. Then, I added this validation on the later question:

count(self.sq_Colname.NAOK) eq Qprevious.shown

«All your survey answers are belong to us »
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
2 years 2 months ago #224924 by DenisChenu
Replied by DenisChenu on topic Array Text, field validation, only one column
I like to have a sq_XX system for this too

is_int(this.sq_INT.NAOK) apply only to line with INT in code.

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose