2
$\begingroup$
data = Dataset[{<|"userId" -> 5311, 
"Rec" -> 
 "You need to improve in Free Response Question type"|>,<|"userId" -> 5312, 
"Rec" -> 
 "You need to improve in Write Code Question type"|>, <|"userId"-> 5313, 
"Rec" -> 
 "You have a great performance in all question types"|>,<|"userId" -> 5314, 
"Rec" -> 
 "You need to improve in Multiple Choice Question type"|>}]

Is there a way to create a manipulate such that the control shows the userId and as I move the control, I see the text corresponding to each userId. Something similar to this:

Manipulate[Grid[{{userId}, {"text"}}, BaseStyle -> {FontFamily -> "Roboto"}], {{userId, 1}, 1, 5}]
$\endgroup$
1
$\begingroup$

Code below is not very efficient, but maybe it does what you want.
Manipulate[Grid[{{data[[Position[data, k][[1, 1]], "userId"]]}, {data[[Position[data, k][[1, 1]], "Rec"]]}},BaseStyle -> {FontFamily -> "Roboto"}], {{k, Normal[data[[All, "userId"]][1]], "userID"}, Normal[data[[All, "userId"]]], ControlType -> RadioButton}]

With your Dataset named data and a RadioButton control this code yields:
enter image description here

$\endgroup$
1
$\begingroup$

Here is one way:

Manipulate[
  data[SelectFirst[#userId == userId&]]
, {userId, data[All, "userId"] // Normal, Slider}
, ContentSize -> Full
]

manipulate

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.