Select to view content in your preferred language

Survey123 - Data from fields removed

2061
7
11-10-2016 12:19 PM
FranciscoAndrade1
Regular Contributor

A survey has been created and anytime the following steps have been performed the quantities get removed:

Configuration of form:

Step 1: 

Input quantity under 'Quantity' field (value greater than or equal to 1).

Step 2:

Update input quantity to Zero under 'Quantity' field.

Step 3:

Update input quantity to greater than or equal to 1 under 'Quantity' field.

Error: Values under fields named, Wattage, Hours/Day, Hours/Years, kWh, Cost Per Month and Cost Annually get removed. Values do not get regenerated.

Video below:

0 Kudos
7 Replies
JamesTedrick
Esri Esteemed Contributor

Can you share the XLS file?  I'm also wondering a bit on the survey design - you have separate sets of questions based on the size of the TV - are they the same questions (for different sizes) or different questions per size?

0 Kudos
FranciscoAndrade1
Regular Contributor

James Tedrick‌ i don't know how to attach the file. See link below for the XLS file.

Appliance Calculator - Test.xlsx - Google Drive  

0 Kudos
JamesTedrick
Esri Esteemed Contributor

Hi Francisco,

What you're experiencing is an interplay between default and relevancy.  As you might expect, a default value is only assigned when the form is created.  When a question goes from relevant to not relevant (i.e., not displayed), the answer for that question is removed; this is to ensure we don't save answers to questions that, according to the form's logic, haven't been asked.  

As a workaround, instead of supplying a default value, we can use a calculation that uses the same statement as your relevant clause in an if statement to calculate in the default value - see attached.

FranciscoAndrade1
Regular Contributor

James Tedrick‌ I am having an issue again with the survey123. See issue below. 

Step 1: The survey is loaded and fields named Estimated KWH Monthly Average and Estimated KWH Annually have a value entered 'zero'.

Step 2: A value is entered in field name Water Pump (Quantity). Values for Estimated KWH Monthly Average and Estimated KWH Annually are updated.

Step 3: A value is entered in field name Pool/Spa Pump (Quantity). Values for Estimated KWH Monthly Average and Estimated KWH Annually are removed.

Note:

Calculation for Estimated KWH Monthly Average can be found on row 713.

Calculation for Estimated KWH Annually can be found on row 714.

I don't know how to attach the file. See link below for the XLS file.

Form 1.xlsx - Google Drive 

Also, if there is something you can recommend to make the loading time quicker it would be great.

Thank you and I appreciate your support.

0 Kudos
JamesTedrick
Esri Esteemed Contributor

Hi,

The issue of the summarization is that you summarizing hidden fields - by default, hidden fields are stored as text.  You need to convert to decimal either by supplying a bind::type column or using the number function.  See the EnergyUsage.xlsx

In terms of making your survey more efficient to load, I would suggest changing it in a few places (see EnergyUsage2.xlsx):

- as opposed to having every question have a relevant statement (your questions tend to have 5 questions with the same relevant statement at a time), create a group that has the relevant statement only

- instead of having a series of select_ones to select the appliance type, use a select multiple per category to select

A more radical change would be to use a repeat to fill in the appliance information, as you have the same 5 questions (number, watt per hour, hours per day, kWh, cost per month) for each item.  You could use the pulldata function with a csv that has the typical WpH and HpDay information to load those values when the appliance type is selected.  I'm working on a sample that does this and will upload later.

FranciscoAndrade1
Regular Contributor

Thank you for the explanation in regards to the hidden fields. I have updated the survey based on your suggestion of energyUsage.xlsx.

I like your idea in regards to the select multiple. 

Look forward to the other sample.

I really appreciate your help you are awesome. Thanks

0 Kudos
FranciscoAndrade1
Regular Contributor

Thanks JTedrick-esristaff

That helped out. I really appreciate the help.

0 Kudos