Where can I find the code that inserts to the question_answer table?

reginabautista
Kilo Sage

Hi guys,

I have an Order Guide and I would like the values entered on the variables to become available in the sc_request table (Top level). I've noticed that there are no entries being created in the question_answer table when a request is submitted using an Order Guide. This means that I won't be able to display the variable labels and values using GlideappSequencedQuestionSet.

 

However, this is working when I use a record producer on it's own. I am trying to find the code that inserts to the question_answer table so that I could include Order Guides in the condition. 

 

Please let me know.

 

Thanks

Regina

1 ACCEPTED SOLUTION

Mark Stanger
Giga Sage

Record producers and Catalog items use 2 completely different tables to store question/variable responses.  You definitely won't want to mix the two tables as they are intended for different purposes.  To get to Request item variable responses you'll want to use the 'Variable ownership' table (sc_item_option_mtom).  That contains a many-to-many relationship between the catalog item and the variable response.  You can drill into either side of the relationship to get more information.

In regards to order guides, the variable responses there aren't stored anywhere at all after the order is submitted.  The order guide itself is simply a UI construct to get the right catalog items in your cart.  If you want to keep order guide variable information, you need to cascade those variables onto the actual catalog items and then view the variables in the variable editor on each item.

Please mark my answer as correct if I've answered your question.

View solution in original post

3 REPLIES 3

Mark Stanger
Giga Sage

Record producers and Catalog items use 2 completely different tables to store question/variable responses.  You definitely won't want to mix the two tables as they are intended for different purposes.  To get to Request item variable responses you'll want to use the 'Variable ownership' table (sc_item_option_mtom).  That contains a many-to-many relationship between the catalog item and the variable response.  You can drill into either side of the relationship to get more information.

In regards to order guides, the variable responses there aren't stored anywhere at all after the order is submitted.  The order guide itself is simply a UI construct to get the right catalog items in your cart.  If you want to keep order guide variable information, you need to cascade those variables onto the actual catalog items and then view the variables in the variable editor on each item.

Please mark my answer as correct if I've answered your question.

Thanks Mark! This info is particularly helpful specially about the Variable ownership. I could now update my code to lookup to this table rather than question_answer to display variable responses on request level. Thank you for guiding me to the right direction. 

 

Cheers

Regina

You're welcome!  Good luck with your project!