How to handle datasets with pictures inside?

Hi all

To improve customers experience, I would like to make a Shiny app in which we load an excel file like this.

The goal is that the customer first filters on "Instrument" with radiobuttons, then on "Error Code" with numberInput. The get the rest of the table on the screen. But most important is also to get the picture.

Filtering a dataset is not difficult for me, but I don't know how to get that picture with it.

eg: choosing "toestel 555" and code "111" should give the correct line of the file, but also the picture in that line.

Thanks in advance!

ui <- fluidPage(

server <- function(input, output, session) {
  my_data <- reactive({
      text_col = letters[1:2],
      image_url_col = c(
    ) |>
      rowwise() |>
        shiny_image_col = as.character(img(src = image_url_col)),
        excel_image_col = paste0('=IMAGE("', image_url_col, '")')
      ) |>

  output$a_table <- DT::renderDataTable(
      req(my_data()) |> select(text_col, shiny_image_col)
    escape = FALSE

  output$dl_1 <- downloadHandler(
    filename = function() {
      paste("test_", Sys.Date(), ".xlsx", sep = "")
    content = function(file) {
      my_data <- req(my_data()) |> select(text_col, excel_image_col)
      wb <- createWorkbook()
      addWorksheet(wb, "testsheet")
      writeDataTable(wb, "testsheet", my_data)
        wb = wb,
        file = file

shinyApp(ui, server)

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.