Validating numeric answer in List question

I need to validate the numeric entry in a list question for my ED Listing questionnaire that is used as the source for my roster.
I have a variable which is the current count for the building (cur_bld).

I tried the following code to accomplish this

cur_bld > 1 ?

(new Func(() =>
{

var cur = self.Select(x => int.Parse(x.Item2));
var nxt = next_dwl;
var d = cur-nxt;

return d==1;

})).Invoke()
:
true

I am now learing C# so not sure where I went wrong

Neville

Dear Neville, we have a questionnaire in the public section which is perfectly suitable for the listing of households in an enumeration are. You can fully adjust the content (i.e. which information you collect in the listing phase), and dont need to worry about the functionality. This questionnaire can be found here: https://designer.mysurvey.solutions/questionnaire/details/e6484fadd91d4fb7966573920a6c7dd2/chapter/3e3f209e1935c28e3e02779955c78e16/static-text/b24854ff99c292621adbb2ddf37d6043

In the first text box, the whole workflow is explained. If your workflow deviates

siginificantly, then feel free to contact me again, with a precise description of your listing workflow, and i am happy to assist you in the modification.

Typical levels for our listing record
Building
Dwelling
Household
Business
Institution
Other Building Types

A sample of a listing could be as below:

Building Dwelling Household
1 1 1
2 2 2
3
4 3 3
4 4 4
4 4 5
5
6 5
6 6 6
6 7 7

Building 3 and 5 are Vacant. In building 6, dwelling 5 the household is vacant so it doesn’t get a number.

I modified the test listing application for my needs and it can do the above situation. I have a variable that calculates the next number but I cannot validate the new listing number eg example

For building 4 dwelling 3 the next household number should be 3, I haven’t figured out how to code the following :
Validation condition is pseudo code:

If next_dwelling > 0
Test ( next_dwelling minus current_dwelling = 1)

I was hoping the code would be something like the following

If Next_dwl > 0
T = next_dwl – Parse.int(@rowname) = 1
I haven’t figured out how to write the if condition to trigger the error.

Any help will be greatly appreciated.

I’m sorry to bring up this old post. I have been trying to locate the questionnaire mentioned in this forum (https://solutions.worldbank.org/questionnaire/details/e6484fadd91d4fb7966573920a6c7dd2/chapter/3e3f209e1935c28e3e02779955c78e16/static-text/b24854ff99c292621adbb2ddf37d6043). Is it still available anywhere?

Good day, can someone send me the link to this questionnaire?

https://designer.mysurvey.solutions/questionnaire/details/e6484fadd91d4fb7966573920a6c7dd2/chapter/c46ee8950e6e4063813631e6bfa7c3f8/group/c46ee8950e6e4063813631e6bfa7c3f8

Good day, thanks for your quick response…but when I click the link I am getting the following message “You don’t have permission to edit this questionnaire”

Is this questionnaire still available anywhere?

Is this questionnaire mentioned above still available anywhere?

I had modified mine, but I think I have the original in my Questionnaires shared with me. Not sure how to make it available for everyone.

Neville

As the discussion here has steered away from the original question I’d like to close it with a conclusive answer. The topic-starter asked the following question:

To validate that all entries in a text list question are integer numbers, we can use the following expression:

self.All(item=>item.Text.IsIntegerNumber())

This is shown in the Public example User questions and common patterns

One can similarly extend the conditions to check for no duplicates, being positive, etc. It is easy to be creative here, but it is equally easy to loose the big picture: the interviewers should not be tasked with entering sequential numbers. Survey Solutions can enumerate the roster items fully automatically by itself (the proverbial @rowcode).