Survey123 v3.5: Nested repeats inbox query

804
4
06-10-2019 09:06 AM
JordanMiller4
Occasional Contributor III

Any idea when nested repeats will work for the inbox query?

Tags (1)
0 Kudos
4 Replies
JamesTedrick
Esri Esteemed Contributor

Hi Jordan,

Nested repeats should work with the Inbox.  What is the behavior that you are seeing?

0 Kudos
JordanMiller4
Occasional Contributor III

Here's the error:                      Searching for surveys

                             code 400

                                                Unable to complete operations

                                                        (       OK button       )

 

Inbox query: DISPATCHEDNAME =${username}

begin repeatNEO_Forms.SDE.DispatchedTableDispatched To: ${DispatchedCounter}    minimal               query allowUpdates=true allowAdds=true    
hiddenDispatchedCounterDispatched Counter        count(${NEO_Forms.SDE.DispatchedTable})       null         
select_one officesDISPATCHEDOFFICEIDOffice ID  yes minimal           esriFieldTypeString50        
select_one workersDISPATCHEDNAMEDispatched To  yes autocomplete           esriFieldTypeString50        
dateDISPATCHEDDATEDispatcher Date  yes     now()       esriFieldTypeDate         
timeDISPATCHEDTIMEDispatcher Time  yes     now()       esriFieldTypeString50        
select_one dispatchedstatusDISPATCHEDSTATUSDispatched Status    minimal                     
end repeat NEO_Forms.SDE.DispatchedTable                          
0 Kudos
JamesTedrick
Esri Esteemed Contributor

Thanks Jordan,

Thanks for the additional information.  Repeat values are not supported in the main survey's definition expression; the value needs to be in the main layer.  Nested repeats do work with the query parameter in the bind::esri:parameters column, but that wouldn't influence the Inbox list.  I've written this down as a possible enhancement, though it would need some thought to be able to properly specify this type of query.

0 Kudos
DataOfficer
Occasional Contributor III

Hi James Tedrick‌,
I have a similar question/problem.
Background: We have a situation where volunteers are carrying out wildlife surveys. The form is setup with repeats and nested repeats. The nested repeat captures species records, within repeats that are occurring at different times/and or locations, within a survey at a particular site. A hidden field assigns a default verification status of unverified. Certain members of the project then have access via a webapp to view the records that are unverified, and edit the status to verified if they are happy that the record is correct (eg. the species has been correctly identified). 
Inbox query: We want to have an Inbox query expression that returns records specific to the user, and with a verification status of unverified. This would be via a query expression of: 

Creator=${username} AND Verification=0

(where 0 means unverified)

However, this does not work and returns the same error when refreshing the inbox that Jordan has described for their use case. Has there been any progress on making it possible to include queries from nested repeats? The workaround I am considering is to create another field in the parent layer that summarises the verification status across the nested repeats and use that within the query (e.g. assign the survey unverified status if any record from the nested repeats is equal to 0 (unverified)). However this is not great as it applies the verification to the whole survey rather than the individual records within it and brings up a few other challenges, including how to auto-update the survey-level verification status (and subsequently the surveys appearing in the Inbox) when the record-level verification status is amended.

Any suggestions?
Thanks,
Rob 

0 Kudos