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
#
type | name | label | appearance | default | readonly | relevant |
select_one update_yesno | record_update | Select Incident Record Type | No | |||
begin group | group1_begin | Input Record | ${record_update}="No" | |||
dateTime | RecordedDateTime | Time to Recorded | horizontal | now() | ||
select_one tofrom | tofrom | Origin of Incident | likert | From | ||
end group | group1_end | end group | ||||
begin group | group2_begin | Update Incident Record | No | ${record_update}="Yes" | ||
begin repeat | UpdatedDateTime0 | Update Time | ||||
dateTime | UpdatedDateTime1 | Time Updated | now() | |||
end repeat | ||||||
begin repeat | UpdatedToFrom0 | Update Origin | ||||
select_one tofrom | UpdatedToFrom1 | Update Origin of Incident | likert | To | ||
end repeat | ||||||
begin repeat | UpdatedStatus0 | Update Status | likert | |||
select_one status | UpdatedStatus1 | Update Incident Status | ||||
end repeat | ||||||
end group | group2_end |
Solved! Go to Solution.
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.
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.
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
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...
I would also like to know how to do this