PL 400 Canvas Apps 4 — Questions and Answers
Question 1: A Canvas App uses a custom connector. The connector requires an API key passed as a header. Where is this configured?
- In the app's OnStart property using Set()
- In the custom connector's security definition and connection setup (Correct answer)
- In the Power Automate flow that wraps the connector
- In Azure API Management policy
Correct answer: In the custom connector's security definition and connection setup
Custom connector authentication, including API key headers, is configured in the connector's Security section and provided when creating a connection.
Question 2: What does the ForAll() function do in Canvas Apps when used with Patch()?
- Filters records matching all conditions
- Iterates over a table and performs Patch on each record in bulk (Correct answer)
- Validates all form fields before saving
- Loops through and deletes all matching records
Correct answer: Iterates over a table and performs Patch on each record in bulk
ForAll(collection, Patch(DataSource, {fields})) performs a bulk operation by running Patch for every row in the collection.
Question 3: In Canvas Apps, which property of a Gallery control determines what record is passed to sub-screens when a gallery item is tapped?
- Gallery.Selected (Correct answer)
- Gallery.Default
- Gallery.AllItems
- Gallery.CurrentRecord
Correct answer: Gallery.Selected
Gallery.Selected holds the currently selected record and is used to pass record context when navigating from a gallery to a detail screen.
Question 4: When a Canvas App Form control's Mode is set to FormMode.New, what does SubmitForm() do?
- Updates the existing record with changes
- Creates a new record in the connected data source (Correct answer)
- Validates fields but does not save
- Navigates to the next screen
Correct answer: Creates a new record in the connected data source
In New mode, SubmitForm() creates a new record in the data source using the values entered in the form's fields.
Question 5: A Canvas App must display error messages from a failed SubmitForm() call. Which property contains the error details?
- Form.Error (Correct answer)
- Form.LastError
- Errors(Form.DataSource, Form.LastSubmit)
- Form.ValidationMessage
Correct answer: Form.Error
The Form control's Error property contains a human-readable error message from the last failed submit operation.
Question 6: Which Canvas App function converts a UTC datetime value to the device's local time zone for display?
- TimeZoneOffset(Now())
- DateAdd(UTCValue, TimeZoneOffset(Now()), Minutes) (Correct answer)
- Text(UTCValue, DateTimeFormat.LongDateTime)
- ConvertTimeZone(UTCValue, 'UTC', Local)
Correct answer: DateAdd(UTCValue, TimeZoneOffset(Now()), Minutes)
DateAdd() combined with TimeZoneOffset() adjusts a UTC datetime by the local offset in minutes to display local time.
Question 7: In a Canvas App, you need to sort a gallery by a date column descending. Which Items formula is correct?
- Sort(DataSource, DateColumn, Ascending)
- SortByColumns(DataSource, "DateColumn", SortOrder.Descending) (Correct answer)
- OrderBy(DataSource, DateColumn, DESC)
- Filter(DataSource, SortOrder = Descending)
Correct answer: SortByColumns(DataSource, "DateColumn", SortOrder.Descending)
SortByColumns() accepts the column name as a string and a SortOrder enum value, making it the correct delegable sort function for Canvas Apps.
A Canvas App uses a custom connector.
The connector requires an API key passed as a header.
Where is this configured?