Duplicating Survey & Editing Records in a Web Form

367
3
Jump to solution
03-15-2020 06:18 PM
LuisMartinez3
New Contributor II

Ok...this one seems like a challenge. I am able to do what I want -somewhat - but not really get the results I want. I made a link on my popup box that links to my survey form so it's possible to go back and edit a survey. I created a button in the form that's associated with a Relevant field so that if its a new survey you can enter the info or if its an Update, keeps the previous info and you can update the new fields in a group...basically adding info to fields related to the update button. I created a repeat and that just adds selections to a related table so that will not work. 

The way it would need to function would be to click the Update Record button and would duplicate all (or some) of the initial survey fields. It wouldn't alter any of the previous surveys and just add/update info regarding the revisit or status. It would serve sort of as a log or a history of surveys.

I did this using Calculations and Relevant fields but it's not really what I'm after (See Form Below). The popup would show the latest info on the map related to status (see Figure 1) but that's not as important at this moment and that's not quite possible using this method. The importance would be to add additional info to each survey. The new information would be added to the popup and controlled by configuring the HTML (see Figure 2). As for now, I dont know how many records would be added, but assume several could be added. Any ideas?

Figure1. - Existing Popup

Figure2. - Desired Outpop

Popup Box1  Popup Box2

#

typenamelabelappearancedefaultreadonlyrelevant
select_one update_yesnorecord_updateSelect Incident Record Type No  
begin groupgroup1_beginInput Record   ${record_update}="No"
dateTimeRecordedDateTimeTime to Recordedhorizontalnow()  
select_one tofromtofromOrigin of IncidentlikertFrom  
end groupgroup1_endend group    
begin groupgroup2_beginUpdate Incident Record No ${record_update}="Yes"
begin repeatUpdatedDateTime0Update Time    
dateTimeUpdatedDateTime1Time  Updated now()  
end repeat      
begin repeatUpdatedToFrom0Update Origin    
select_one tofromUpdatedToFrom1Update Origin of IncidentlikertTo  
end repeat      
begin repeatUpdatedStatus0Update Statuslikert   
select_one statusUpdatedStatus1Update Incident Status    
end repeat      
end groupgroup2_end     
0 Kudos
1 Solution

Accepted Solutions
JamesTedrick
Esri Esteemed Contributor

Hi Luis,

I'm not quite sure I completely follow your workflow.  You would need to determine whether a new record needs to be created or an existing record updated at the 'button' (link to open Survey123) step.  The easiest way to accomplish this would be to have 2 buttons in the pop-up, one to edit the existing record and a second to create a new record based on the data of this survey.

View solution in original post

0 Kudos
3 Replies
JamesTedrick
Esri Esteemed Contributor

Hi Luis,

I'm not quite sure I completely follow your workflow.  You would need to determine whether a new record needs to be created or an existing record updated at the 'button' (link to open Survey123) step.  The easiest way to accomplish this would be to have 2 buttons in the pop-up, one to edit the existing record and a second to create a new record based on the data of this survey.

View solution in original post

0 Kudos
LuisMartinez3
New Contributor II

James, I actually did exactly what you did. I got it to work. It was all just a URL issue and a comma, go figure. It works great!

Thanks for the response and input.

Luis

Luis Martinez

Geographic Information Systems Office

St. Charles Parish

15012 River Road

Hahnville, LA 70047

phone 985.331.3003

0 Kudos
KimberlyMcCallum
New Contributor III

I'm not sure if this thread is still active but I was wondering if someone (James) could elaborate on how to create a new record with values copied from an existing record. 

I am looking for a way to create a new record that is prepopulated with data from an existing record. I was trying to do this using the mode parameter via the survey URL but mode=edit will change an existing record, mode=view is read only and I get an error: "Cannot read property 'view' of undefined" if I leave this out...

0 Kudos