Survey123 – sometimes doesn't send answers of required fields into the database

429
4
11-09-2022 06:51 AM
TihanaPolezari
New Contributor II

I will simplify my Survey123 form.

My form consists of two begin repeat sections that have the same questions except of one question.

This one question is in the first begin repeat section and on it depends automatic data copying into the second begin repeat section.

All questions are required, in both, first and second begin repeat section.

Meaning the following:

First Begin Repeat

 

 

select_one AorB

Type_Of_Event

 

select_one

BR1_Question1

 

dateTime

BR1_Question2

 

geopoint

BR1_Question3

 

 

Second Begin Repeat

 

 

select_one

BR2Question1

if(regex(${Type_Of_Event},'A'),${BR1_Question1},null)

dateTime

BR2_Question2

if(regex(${Type_Of_Event},'A'),${BR1_Question2},null)

geopoint

BR2_Question3

if(regex(${Type_Of_Event},'A'),${BR1_Question3},null)

 

 

Sometimes, but not always, occurs that answers of the second begin repeat section are not sent into the database (Enterpise Portal 10.9.1., DataStore). I access the data using ArcGIS Pro by connecting to the Portal through drag and drop Feature Layer to map.

The answers in the inbox are displayed as if they had just been answered (blue color text) when the Event is A on which depends automatic data copying.

I am using Survey123 Field App 3.15.156

 

I can't figure out why, because all questions are required and must be answered, otherwise form cannot be sent.

Since there are answers to the questions from the first begin repeat section, it could be realized that the form has been sent and all questions are answered.

For further data analysis, I need the answers from the second begin repeat section and because of the data gathering logic, these questions need to be in the second begin repeat section.

0 Kudos
4 Replies
DougBrowning
MVP Esteemed Contributor

First I am confused on why you are using regex?  That is for input masks.  Is this in the calculation field?  Second null does not exist in 123 at all.  So your calc does not look like it would work at all to me.

If you are checking for the value of A then if(${Type_Of_Event} = 'A', ${BR1_Question1}, '') is what you would want.  Use '' not null.

Hope that helps

0 Kudos
TihanaPolezari
New Contributor II

I am using regex because I have multiple TypeOfEvent for which data is copied. I was trying the same combination of answers and sometimes occurs that the answers are not sent and sometimes they are, so basically, it works with regex when sometimes data are sent. 

The form is too complex and unfortunately, I cannot share it on the internet to show you.

I will try your logic for calculation with multiple OR statements, so I hope it will help. Thanks for your answer. 

0 Kudos
GregKeith
Occasional Contributor III

Repeat answers go in separate linked tables, not the main feature layer table. This doesn't explain why some answers show and others don't, but may be a place to start looking.

0 Kudos
TihanaPolezari
New Contributor II

Yes, I know that. Thanks for your answer.

0 Kudos