Support

Home Forums Event Espresso Premium How do I go into the esp_answer table and delete any records there?

How do I go into the esp_answer table and delete any records there?

Posted: July 15, 2020 at 4:09 pm


tbex

July 15, 2020 at 4:09 pm

Josh mentions this in this post in the forums: https://eventespresso.com/topic/unable-to-editmove-question-following-permanent-deletion-of-all-registrations/

But he does not go into how to access the esp_answer table.

Bottom line, I am trying to edit question types in my registration questions and it will not let me even though this is a brand new event with no registrations.

I keep getting this error: “Because there are currently answers for this question in the database, your options to change the question type have been limited to similar question-types. “


Tony

  • Support Staff

July 16, 2020 at 7:56 am

Hi there,

Modifying the database tables directly is not expected for an end-user so the reason Josh didn’t provide any additional details in that thread is due to the fact that the previous user showed they are already familiar with the database tables.

That user mentioned their esp_registration table was empty, which means they can’t have registrations with relationships to questions/answers because there are no registrations and so its safe to manipulate esp_answer if you know how to.

Bottom line, I am trying to edit question types in my registration questions and it will not let me even though this is a brand new event with no registrations.

So you have no registrations on the site at all that are linked to that question?

The question will lock if ANY registration has been made with a relationship to that question, not per event but on your entire site. To explain a litte:

If you have a question with ID 111 and its type is Dropdown, when you register onto an event that is using that question in one of its groups there are relationships set up to that question and it’s answer, how they relate and how the object is setup within the database determines how the question/answer are generated from that point on.

If we then allowed you to simply change question ID 111 to whatever you want, let’s say a text box, the relationship for all previous registrations linked to that question is now broken. The answer knows it related to question ID 111 and so when it comes to generate the answer using the question type (which in this example was allowed to be changed to a textbox), things break.

So you are welcome to add another question to your question groups in place of that one (if you do that I recommend changing the original question to be admin only), but you can’t modify the exisitng question to be something completely different to what everything else is expecting it to be.

Can you explain what change you are trying to make? From the sounds of it you’ll need to add another question in place of the current one, but if you can add more specifics I’ll let you know more.


tbex

July 16, 2020 at 2:21 pm

Hi Tony,

Thank you. It helps a bit even if it wasn’t the answer I wanted. Your suggestion sounds like a work around. I can add a new question.

All I want to do is change the question type from a text field to checkboxes. We have found we get better responses that way.


Tony

  • Support Staff

July 20, 2020 at 5:04 am

Then yes, you need to add another question in place of the original checkbox question as thats a completely different question/answer relationship. You can not change how a question relates to its answers (as above) so you’ll need to replace it with another.

The steps I posted above aren’t really a workaround as its the expected behaviour for EE’s questions.

So in short:

1. Create your new question as a text question.
2. Edit the question group and add that new question to it, et the ordering as needed to match the current setup if needed.
3. Edit the original question and set it to ‘Admin only’ if you need the current responses to be included for current registrations.

You must be logged in to reply to this support post. Sign In or Register for an Account

Support forum for Event Espresso 3 and Event Espresso 4.
Documentation for EE3 and EE4
Documentation for Event Espresso 3 Documentation for Event Espresso 4

Status: publish

Updated by  Tony 3 months, 1 week ago ago

Topic Tags

Notifications

This topic is: not resolved
Do NOT follow this link or you will be banned from the site!
[gravityform id=80 title=false description=false ajax=false]
<div class='gf_browser_unknown gform_wrapper' id='gform_wrapper_80' ><form method='post' enctype='multipart/form-data' id='gform_80' action='/topic/how-do-i-go-into-the-esp_answer-table-and-delete-any-records-there/'> <div class='gform_body'><ul id='gform_fields_80' class='gform_fields top_label form_sublabel_below description_below'><li id='field_80_1' class='gfield gfield_contains_required field_sublabel_below field_description_below gfield_visibility_visible' ><label class='gfield_label' for='input_80_1' >First name<span class='gfield_required'>*</span></label><div class='ginput_container ginput_container_text'><input name='input_1' id='input_80_1' type='text' value='' class='medium' aria-required="true" aria-invalid="false" /></div></li><li id='field_80_2' class='gfield gfield_contains_required field_sublabel_below field_description_below gfield_visibility_visible' ><label class='gfield_label' for='input_80_2' >Email address<span class='gfield_required'>*</span></label><div class='ginput_container ginput_container_email'> <input name='input_2' id='input_80_2' type='email' value='' class='medium' aria-required="true" aria-invalid="false" /> </div></li><li id='field_80_3' class='gfield gfield_contains_required field_sublabel_below field_description_below gfield_visibility_visible' ><label class='gfield_label' >GDPR Agreement<span class='gfield_required'>*</span></label><div class='ginput_container ginput_container_checkbox'><ul class='gfield_checkbox' id='input_80_3'><li class='gchoice_80_3_1'> <input name='input_3.1' type='checkbox' value='I consent to have this website store my submitted information so they can respond to my inquiry.' id='choice_80_3_1' /> <label for='choice_80_3_1' id='label_80_3_1'>I consent to have this website store my submitted information so they can respond to my inquiry.</label> </li></ul></div></li><li id='field_80_4' class='gfield gform_validation_container field_sublabel_below field_description_below gfield_visibility_visible' ><label class='gfield_label' for='input_80_4' >Comments</label><div class='ginput_container'><input name='input_4' id='input_80_4' type='text' value='' autocomplete='off'/></div><div class='gfield_description' id='gfield_description_80_4'>This field is for validation purposes and should be left unchanged.</div></li> </ul></div> <div class='gform_footer top_label'> <input type='submit' id='gform_submit_button_80' class='gform_button button' value='Download Now' onclick='if(window["gf_submitting_80"]){return false;} if( !jQuery("#gform_80")[0].checkValidity || jQuery("#gform_80")[0].checkValidity()){window["gf_submitting_80"]=true;} ' onkeypress='if( event.keyCode == 13 ){ if(window["gf_submitting_80"]){return false;} if( !jQuery("#gform_80")[0].checkValidity || jQuery("#gform_80")[0].checkValidity()){window["gf_submitting_80"]=true;} jQuery("#gform_80").trigger("submit",[true]); }' /> <input type='hidden' class='gform_hidden' name='is_submit_80' value='1' /> <input type='hidden' class='gform_hidden' name='gform_submit' value='80' /> <input type='hidden' class='gform_hidden' name='gform_unique_id' value='' /> <input type='hidden' class='gform_hidden' name='state_80' value='WyJbXSIsIjBiNjdjZjkyMDUzOWUxOWY5Y2NiZjIwMzM4YjA1Mjk4Il0=' /> <input type='hidden' class='gform_hidden' name='gform_target_page_number_80' id='gform_target_page_number_80' value='0' /> <input type='hidden' class='gform_hidden' name='gform_source_page_number_80' id='gform_source_page_number_80' value='1' /> <input type='hidden' name='gform_field_values' value='' /> </div> </form> </div><script type='text/javascript'> jQuery(document).bind('gform_post_render', function(event, formId, currentPage){if(formId == 80) {} } );jQuery(document).bind('gform_post_conditional_logic', function(event, formId, fields, isInit){} );</script><script type='text/javascript'> jQuery(document).ready(function(){jQuery(document).trigger('gform_post_render', [80, 1]) } ); </script>
[i]
[i]