I've been on this all night so I hope someone could help me. I am not proficient in Rshiny at all.
Sample data:
library(tidyverse)
full_data <- tibble::tribble(
~Key, ~Description, ~DetailsAvailable, ~Inputs, ~Choices, ~Unit,
"AAAA", "descrAAAA", NA, "input1", NA, "miles",
"AAAA", "descrAAAA", NA, "input2", NA, "date",
"AAAA", "descrAAAA", NA, "input3", NA, "USD",
"BBBB", "descrBBBB", "yes", "input1", NA, "miles",
"BBBB", "descrBBBB", "yes", "input4", NA, "USD",
"BBBB", "descrBBBB", "no", "selectinput1", "input1", "miles",
"BBBB", "descrBBBB", "no", "selectinput1", "input2", "date",
"BBBB", "descrBBBB", "no", "selectinput2", "input5", "USD",
"BBBB", "descrBBBB", "no", "selectinput2", "input3", "USD",
"BBBB", "descrBBBB", "no", "input7", NA, "USD",
"BBBB", "descrBBBB", "no", "input8", NA, "miles"
)
What I want:
Select unique entries of Key (AAAA and BBBB) from a dropdown. Conditional on key, the variable DetailsAvailable (yes, no) can be selected from a second drop down. Then, I want to see unique entries (as in, I don't want the description of AAAA, which is the same for all AAAA entries, to be displayed multiple times).
- Example output 1
I select AAAA from the drop down. Since DetailsAvailable is N/A, there will be no second drop down menu.
Output:
Key: AAAA
Description: descrAAAA
DetailsAvailable: N/A
| Inputs | Unit |
|---|---|
| input1 | miles |
| input2 | date |
| input3 | USD |
- Example output 2
I select BBBB from the drop down. A second drop down appears and I select "no".
Output:
Key: BBBB
Description: descrBBBB
DetailsAvailable: no
| Inputs | InputChoice | Unit |
|---|---|---|
| selectinput1 | input1 | miles |
| selectinput1 | input2 | date |
| selectinput2 | input3 | USD |
| selectinput2 | input5 | USD |
| input7 | USD | |
| input8 | miles |