I am trying to create dynamic UI in my Shiny app. I increment a variable (dealNumber) every time I add an input via a button. However, I need to get the values from these new inputs. I add the value of dealNumber to the IDs of each input. However, I am having a hard time extracting the values.
#I use the following code to create a new input
#dealNumber = 1
column(2,selectInput(paste("optionType",dealNumber,sep=""), label = h5(""),choices = option_type, selected = 1)
#I then need to assign the value from the input above to the variable OptionType. If i use input$"OptionType1" or input$OptionType1 it works. But I need to get the number 1 via a variable so that the code is dynamic.
#I have tried the code below without any sucess
assign("OptionType",input$paste("OptionType",dealNumber,sep=""),.GlobalEnv)
I would appreciate any help.
Thank you