Can't store values to data in reactive environment #178
Replies: 5 comments
-
Yes, this is currently on our todo list to fix. The 7th one down on the list says " Right now, Here is a simpler example that we have been working with for testing to try and solve this problem: This survey asks for two numbers then displays the product. The product is computed in the server like this: observe({
product <- as.numeric(input$first_number) * as.numeric(input$second_number)
sd_store_value(product)
output$product <- shiny::renderUI(product)
}) The last line creating the To explain a little more why this isn't working, the So what we need to do is add something somewhere else in the server to update reactive values, which will probably involve updating the code in the |
Beta Was this translation helpful? Give feedback.
-
I just created an issue from this discussion because this is an actual bug in how |
Beta Was this translation helpful? Give feedback.
-
Just to let you know: For now, I just saved the randomly assigned pairs for the comparison as a collapsed character vector in one variable in the server. This avoids the problem with the sd_store_values() function in the reactive environment when I tried to store it in the reactive loop of creating each question and store each pair separately. |
Beta Was this translation helpful? Give feedback.
-
Okay. The bigger picture problem is that we still don't have a systematic way to store values that are reactively updated in the server into the resulting survey data, and that is something we definitely should be able to do. I already know what we need to do as well, I just need the time to sit down and work it out. We'll eventually get on it. |
Beta Was this translation helpful? Give feedback.
-
This is now addressed. As of v0.8.2, reactive values will be stored with |
Beta Was this translation helpful? Give feedback.
-
Description
Hello,
I can't help myself again. For a kind of Wiki-Survey, which I could already implement successfully with surveydown, I fail to save values in a new variable. For the pairwise comparison of statements, an Excel file is loaded in the
app.R
file at the beginning and the different paired statements are stored randomly in a nested list object. Depending on the selection in a prior question, a set of different pairs is selected from this nested list, which are then displayed and evaluated one after the other. The display and answering works well, also the storing of the chosen statement. However, I can't get the pair of statements that was shown stored in the data withsd_store_value()
.To give you an idea what this wiki-survey looks like (but in german), check: https://shiny2.wzb.eu/munnes/wikisurvey/
In the
server()
function in theapp.R
file I have anobserver
function, looping through the chosen set of pairs and creating a question for each set. To know which two randomly assigned statements the participants could choose from in this questions, I try to store this two values as a collapsed text value:Beta Was this translation helpful? Give feedback.
All reactions