Question
You have a canvas app.
The canvas app must store data in a variable that is available only to the current screen.
You need to create the variable.
Which two functions should you use? Each correct answer presents a complete solution.
NOTE: Each correct selection is worth one point.
- A. UpdateContext Correct
- B. Navigate Correct
- C. SaveData
- D. Set
- E. Collect
Explanation
Context variables are scoped to a single screen, and two functions create them. UpdateContext creates or updates context variables on the current screen. Navigate can also set context variables through its optional UpdateContextRecord argument (for example, Navigate(Screen2, ScreenTransition.None, {varName: value})), and those variables are available only on the screen it navigates to. Set creates global variables, which are available across the whole app. SaveData stores a collection on the device, and Collect adds records to a collection, which is also app-wide.