If I understand the question correcly, all you need to do is display to the user company names and have company ids passed to the server.
I suppose this feature was not available back in the days (and you had to work around as suggested above) but nowadays the argument choices in selectInput function accepts named lists exactly for this need. Hopefully example below clarifies the situation.
library(shiny)
library(tidyverse)
companies <- tribble(
~name, ~id,
"McDonalds", 1,
"Wendy's", 2,
"Bestbuy", 3
)
ui <- fluidPage(
uiOutput("select_company_ui"),
textOutput("value")
)
server <- function(input, output) {
output$select_company_ui <- renderUI({
selectInput("select_company", "Select company", choices = deframe(companies))
})
output$value <- renderText(paste0("Value of the company filter is ", input$select_company))
}
# Run the application
shinyApp(ui = ui, server = server)
Here you can see the resulting app:
Side note: I use function deframe from package tibble to turn a tibble into a named list just for convenience, you could do without it by writing
choices = c("McDonalds" = 1, "Wendy's" = 2, "Bestbuy" = 3)