select_one_from_file with pulldata() works in Survey123 Connect but not in Survey123

842
11
09-27-2023 08:09 PM
TI
by
Occasional Contributor II

We are using ‘Survey123 Connect’ 3.18.124 to develop our surveys and we are using ‘Survey123’ 3.18.145 on iOS to use the surveys.

In one of our surveys, we are using a “select_one_from_file” question type in order to get choices from a CSV file bundled with the survey.

In Survey123 Connect, it displays the choices correctly as a list of radio buttons.

But in the real Survey123 app on the device, it displays no choices at all.  It just shows the question Label and the question Note, but no choices (or anything else before the next question).

It may be worth noting that this question also has a very simple choice_filter.  It works fine in Survey123 Connect.

I don't think it's relevant, but this question is within a repeat.

How can I get the choices to appear as expected in Survey123 on iOS?

Tags (1)
0 Kudos
11 Replies
DougBrowning
MVP Esteemed Contributor

Does the CSV have a space in the file name at all?  And the case of the name matches.  Just a guess.

0 Kudos
TI
by
Occasional Contributor II

That's always worth checking.  But in this case, there is no space in the file name and the case matches OK.

DougBrowning
MVP Esteemed Contributor

Yea only other idea is a special char somewhere.  That gets me on the regular.  Connect is more forgiving than the tablet.

0 Kudos
TI
by
Occasional Contributor II

That's another good suggestion.  So I tested this theory by wiping out the entire contents of the CSV (1,500 rows), and typing in just a few rows manually, using only simple characters.

The problem persists with a CSV that contains only known simple characters.  😥

0 Kudos
TI
by
Occasional Contributor II

I have now created a cut-down version of the survey for testing that only includes a very small number of questions (ie, the problem question itself, its repeat and its group, and all the questions it depends on and that are dependent on it).

It WORKS!

So now its matter of adding back in all of the questions, and using a more fine-grained attrition to figure out which questions/calculations, etc, are causing the issue.  I'll post back when I get some results.

TI
by
Occasional Contributor II

Well this is getting completely BIZARRE!  If I create a completely new survey and replace its form .xlsx with the one from the buggy survey, and also copy in the buggy survey's .csv file to the new survey's media folder, the new test survey works perfectly!

What else within the survey could be causing this, if it is not anything within the .xlsx or the .csv?

It appears that I could get around the problem by publishing as a completely new survey, but then all the users would have to be educated to stop using the old survey, to delete it from their devices, and then to download another survey that (to all intents and purposes) is exactly the same.  (Not to mention the issues with other apps that are already using the survey's feature service).

Is there some way to identify the problem with the existing survey and to fix it without having to publish as a new survey ID?

DougBrowning
MVP Esteemed Contributor

You may be able edit the .iteminfo file and point it to the old survey.  Little risky in Production so make sure you have a backup and all that.  It would be good to test this on a non Production form first.

The two main ones to change are

"owner": "",
"ownerFolder": which is the item id

"id": "this is the item id of the form",

I think all the naming needs to be exact also.  I have done this before to move owners is folders but not repoint a form like you are doing.

Other idea is swap out the XLXS in the old form with the new form in the My Survey Designs folder and see if it works.  But there may be something buried in there and is causing it.

Good luck

0 Kudos
TI
by
Occasional Contributor II

Thanks for this information.  I may give it a shot.  So long as I keep a good back-up of the .csv and .xlsx, the worst that can happen is that I'll have to create a new survey (with my copies of .xlsx and .csv) and get all the users to switch over to the new survey.  Right?

Although... here's a curly one...

I've had experiences where temporary (eg, testing) copies of surveys have been finished with, and then of course when deleting them, their entire online presence, including even the feature service, gets deleted as well.  In some cases, this has resulted in the production feature service being deleted!

In this case, I'm not too worries about the feature service, as this particular survey uses a hard-coded URL in the .xlsx 'Settings' which points to a proxy service which redirects to our ArcGIS Online service.  So I think that's safe (fingers crossed - and lots of backups).

What does concern me with this strategy is that if I get the new survey all running OK using the old survey's ID, then at some point, I'm going to want to delete the old survey.  Is is possible to delete the old (buggy) survey without having the new survey destroyed also?

Or will publishing the new survey effectively replace the old survey in-place, such there there is still only the one survey?  (In which case I can just delete the folder from the Survey123 Connect folder on my Windows PC.)

Again, I guess I can try it and find out.

0 Kudos
TI
by
Occasional Contributor II

I think this has resolved the issue.  However, the answer is not as simple as this.  There were (as half-expected) some complication along the way.

When it was all finished, I ended up with TWO copies of the survey on my device.  Attempting to delete ONE of them resulted in BOTH of them being deleted.  No problem, I re-downloaded the survey onto the device, and it works (without the bug that I've been trying to deal with).  Hooray!

However, that led me to think... what if the problem was on the device itself?  I didn't get around to testing on other devices, so I am left wondering if the problem could have been fixed simply by deleting/re-downloading on the device?  (Yes, I SHOULD have tried this earlier on).

Now the other complications that occurred along the way, in brief:

I published the new survey BEFORE making any changes.  I decided this may be necessary, because several items are missing from the .iteminfo if the survey is not yet published, of course.  Including the owner and owner_folder.

Firstly, I attempted to change the .iteminfo while Survey123 Connect was NOT running.  The result of this was that when Survey123 Connect was started up again, it wanted to re-download the new survey from ArcGIS Online before it would allow me to do anything with it.  Well, I  wasn't sure if that would help or hinder, so I deleted it and started again.

This next time, I made the changes to .iteminfo while Survey123 Connect was running.  However, after publishing, I found that it had reverted the .iteminfo content (presumably from some in-memory cache?).  So it just published to the new online survey again instead of to the old one I was trying to replace.  So a bit more stuffing around, and I can't remember the exact details, but the next time I published it, IT WORKED!

It replaced the old/buggy survey, and it worked on the device.

I was then able to delete the new survey in both Survey123 and in ArcGIS Online.

All seems to be OK now.

But I'll be staying close to the phone in case users start telling me they have serious problems with it!

0 Kudos