Learn how to create and assign values to variables that are available only within the current screen of a canvas app using the UpdateContext and Set functions in Microsoft Power Platform.
Table of Contents
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
B. Navigate
C. SaveData
D. Set
E. Collect
Answer
A. UpdateContext
D. Set
Explanation
To create a variable that is available only to the current screen in a canvas app, you should use the following two functions:
- UpdateContext: This function allows you to create or update a context variable within the app’s memory. The context variable is scoped to the current screen and is not accessible from other screens or components.
- Set: This function is used to assign a value to a variable. When used in conjunction with the UpdateContext function, it allows you to set the value of the context variable created with UpdateContext.
Example usage:
UpdateContext({varName: Set(value, …)})
In this example, UpdateContext creates or updates a context variable named “varName” with the value set by the Set function. The value can be a constant, an expression, or a reference to another variable or data source.
By using these two functions together, you can create a variable scoped to the current screen and assign its initial value, ensuring that the variable is accessible only within the context of that specific screen.
Microsoft Power Platform Functional Consultant PL-200 certification exam practice question and answer (Q&A) dump with detail explanation and reference available free, helpful to pass the Microsoft Power Platform Functional Consultant PL-200 exam and earn Microsoft Power Platform Functional Consultant PL-200 certification.