Select to view content in your preferred language

Empty answer when editing a survey from Outbox or Sent folder, using revelant and choice_filter in nestead repeats

1183
6
Jump to solution
04-12-2024 12:13 PM
RejeanLabbe
Occasional Contributor

Hi!

When I edit a survey from the Outbox or from the Sent folder, an answer which is in nestead repeats stays empty.

There is a criteria in the relevant column of the second repeat that checks the value of a question which is outside the repeat.

There is also a criteria in the choice_filter column that uses a question which is outside of the repeat.

 

My survey tab

typenamerelevantchoice_filter
begin repeatinspected_element  
select_one locationlocation  
select_one yes_noissue_exists  
begin repeatissue${issue_exists} = "yes" 
select_one issueissue_name filter_1=${location}
end repeat   
end repeat   

 

My choices tab

list_namenamelabelfilter_1
yes_noyesYes 
yes_nonoNo 
    
locationIndoorIndoor 
locationOutdoorOutdoor 
    
issuePaintPaintIndoor
issuePaintPaintOutdoor
issueWaterWaterIndoor
issueWaterWaterOutdoor
issueGardenGardenOutdoor
issueFloorFloorIndoor

 

My software versions

SoftwareVersionOS
Survey123 Connect3.19.116Windows
Survey1233.19.121Windows
Survey1233.19.121Android
0 Kudos
1 Solution

Accepted Solutions
abureaux
MVP Frequent Contributor

I just tried it. I was able to get all the values to populate with a little change: I swapped "Relevant" for "body::esri:visible".

Just be aware that if you go this route, all required questions still apply even if something isn't visible. This can be easily solved with a dynamic "required" field (i.e., use an IF() statement to calculate required=yes)

View solution in original post

6 Replies
abureaux
MVP Frequent Contributor

You need to add query allowUpdates=true to bind::esri:parameters

This is very important for Repeats being edited.

0 Kudos
RejeanLabbe
Occasional Contributor

Thanks for your help @abureaux . I forgot to put this parameter in the first repeat.

I added it without luck. That doesn't resolve the issue.

Have you tried my Excel file?

0 Kudos
abureaux
MVP Frequent Contributor

I just tried it. I was able to get all the values to populate with a little change: I swapped "Relevant" for "body::esri:visible".

Just be aware that if you go this route, all required questions still apply even if something isn't visible. This can be easily solved with a dynamic "required" field (i.e., use an IF() statement to calculate required=yes)

RejeanLabbe
Occasional Contributor

It's not the way I was expected, body::esri:visible is not something that I uselly use, but it works!

I realy think that this is a bug that ESRI should fix because it could happens to anyone.

My real survey is much complex that the sample I put in this post, but I will adjust the required criterias as you told.

Thanks you so much @abureaux 

0 Kudos
abureaux
MVP Frequent Contributor

body::esri:visible has some excellent uses!

I agree that this does seem like a bug. I would suggest you bring this up with Esri Support in the hopes of it getting logged as such and eventually fixed. At least there is a relatively easy workaround for now.

For those that find this thread in the future and are curious about body::esri:visible vs. relevant:

FieldSameDifferent
body::esri:visibleUses logic statements to dynamically show/hide a question, group, or repeat.

Hidden items are just "invisible".

Data entered into fields still exists and is not lost.

Required fields are still required, meaning they need valid data entered prior to sending (you can bypass this with dynamic required fields)

relevantUses logic statements to dynamically show/hide a question, group, or repeat.

Hidden items no longer exist.

All data is lost when the field is hidden.

Required fields no longer exist, meaning a hidden field that's required will not cause any issues.

 

RejeanLabbe
Occasional Contributor

I have also realized that this issue happens only to the first element of the repeat list.

I removed the required criteria from the Issue name question and the other elements are selected.

0 Kudos