79831949

Date: 2025-11-27 17:06:08
Score: 2.5
Natty:
Report link

Thank you @Limey. I am not very familiar with this "new" (for me) format of Q&A in SO.... Anyway, here is a reproducible example, where I try to get what I need. However, as you can see, "Hello World!" is printed any time any input is updated (not only the ones with the suffix I want). If I put an isolate in my input.sel definition, nothing is triggered except when the object is initialized.

if (interactive()) {
  shinyApp(
    ui = fluidPage(
      numericInput("a", "Value", 5),
      numericInput("b", "Value", 5),
      numericInput("a-filter", "Value", 5),
      numericInput("b-filter", "Value", 5),
    ),
    server = function(input, output) {
      input.sel <- reactive({
        my_inputs <- reactiveValuesToList(input)
        my_inputs[endsWith(names(my_inputs),"-filter")]
      })
      observeEvent(input.sel(), {
        print("Hello World!")
        input.sel()
      })
    }
  )
}
Reasons:
  • Blacklisted phrase (0.5): Thank you
  • Blacklisted phrase (0.5): I need
  • RegEx Blacklisted phrase (1): I want
  • Long answer (-0.5):
  • Has code block (-0.5):
  • User mentioned (1): @Limey
  • Self-answer (0.5):
  • Looks like a comment (1):
  • High reputation (-1):
Posted by: umbe1987