Select to view content in your preferred language

Issue with indexed-repeat() for Date Fields in XLSForm

360
5
3 weeks ago
JuanTomásMartinez17
Esri Contributor

Hello everyone,
I’m working on an XLSForm where I need to retrieve the information entered in the last repeat using the indexed-repeat() function. This works perfectly for text fields, but I’m having trouble with date fields—they don’t seem to return the expected value.
The idea is that users will enter data in repeats daily, and fields outside the repeat should display the last value entered. For text fields, this is functioning as intended, but for date fields, it’s not.
I’ve attached the .xlsx file for reference.

Thanks in advance for your help!

0 Kudos
5 Replies
Neal_t_k
Frequent Contributor

@JuanTomásMartinez17 I loaded up your xlsx, and for me, it appears to be correctly functioning as you described/intended? Can you explain further what you are seeing vs expecting or share some screen shots of what you are getting?

0 Kudos
JuanTomásMartinez17
Esri Contributor

Thanks to your message, I noticed that the description I initially gave was not correct. The problem is that in my workflow, the user will access the survey through a dashboard, using the link arcgis-survey123:///?itemID=myitemid&action=edit&update=true&q:where=objectid=2, so that it opens directly in the desktop/mobile app.

It is there that it is not behaving correctly.

In the desktop app, creating a new submission works fine. The problem seems to appear when the record is being edited.

0 Kudos
Neal_t_k
Frequent Contributor

@JuanTomásMartinez17 First thought is I see you have the url set to edit, but I am not seeing in the xlsx that you have the parameters set to edit the existing repeats.  Try adding allowUpdates=true query  to the bind::esri:parameters column.

https://doc.arcgis.com/en/survey123/desktop/create-surveys/prepareforediting.htm#ESRI_SECTION1_80CFF...

Its been a while, but if I recall if you don't set those parameters, when you pull up that record it doesn't pull the previous repeat data into the form. So your calcs would return only whatever was entered during the current session.  

"query" should pull in the old records, not editable, to view, and then allowUpdates=true would be if you wanted to be able to edit the previous submitted data in that repeat.

I haven't done this exact workflow, but I would try that first.

0 Kudos
JuanTomásMartinez17
Esri Contributor

Hi @Neal_t_k 

 

I just tried adding allowUpdates=true to the bind:.esri::parameters column for the begin repeat question but the problem persists. I think it's important to make it clear that this behavior only occurs with Date-type questions; the same flow was set up for Text questions and it works correctly.

 

Any other ideas? What is the difference in the app's behavior between edit mode and a new record so that the problem only occurs in edit mode?

0 Kudos
Neal_t_k
Frequent Contributor

@JuanTomásMartinez17 I tried to replicate your workflow from your xlsx, this time opening from the constructed link, and it is working correctly for me.  The dates and the text from the last repeat entered are showing correctly in your calculation questions.  Only caveat I am seeing is that when the form opens, it opens to the 1st repeat, which should have different information. But when you navigate to the last repeat, the calculations match what is entered in the repeat.

The only thing different I added to your xlsx is added the "allowUpdates=true query"  to the bind:.esri::parameters column for the repeat question, but everything else was the same.  Did you add "query" when you tested or just "allowupdates"? "query pulls all the old repeats in. I would try adding "query"  and if it still doesn't work, try a fresh publish.  

Other than that, I am not sure, what you have appears to work in my tests.

0 Kudos