exam questions

Exam PL-400 All Questions

View all questions & answers for the PL-400 exam

Exam PL-400 topic 7 question 11 discussion

Actual exam question from Microsoft's PL-400
Question #: 11
Topic #: 7
[All PL-400 Questions]

HOTSPOT -
A delivery service uses a canvas app to track and deliver packages. The app uses SQL Server as a data store. The database includes the following tables:

The app includes the following code to save all required information. (Line numbers are included for reference only.)

For each of the following statements, select Yes if the statement is true. Otherwise, select No.
NOTE: Each correct selection is worth one point.
Hot Area:

Show Suggested Answer Hide Answer
Suggested Answer:
The ClearCollect function deletes all the records from a collection.
Syntax: ClearCollect( Collection, Item, ... )
Collection ג€" Required. The collection that you want to clear and then add data to.
Item(s) - Required. One or more records or tables to add to the data source.

Box 1: Yes -
The Patch function in Power Apps modifies or creates one or more records in a data source, or merges records outside of a data source.
Use Patch with the Defaults function to create records.

Box 2: No -
The return value of Patch is the record that you modified or created. If you created a record, the return value may include properties that the data source generated automatically. However, the return value doesn't provide a value for fields of a related table.
For example, you use Set(MyAccount, Patch(Accounts, First(Account), 'Account Name': "Example name"); and then MyAccount.'Primary Contact'.'Full Name'. You can't yield a full name in this case. Instead, to access the fields of a related table, use a separate lookup such as:
LookUp(Accounts, Account = MyAccount.Account).'Primary Contact'.'Full Name

Box 3: Yes -

Box 4: Yes -
Merge records outside of a data source.
Specify two or more records that you want to merge. Records are processed in the order from the beginning of the argument list to the end, with later property values overriding earlier ones.
Patch returns the merged record and doesn't modify its arguments or records in any data sources.
Reference:
https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-clear-collect-clearcollect

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
jimbo7
Highly Voted 3 years ago
For the last question, the answer should be no, as the syntqx is still the one for creating/modifying a record in a data source and not for merging two recorda outside of the source: Modify or create a record in a data source Patch( DataSource, BaseRecord, ChangeRecord1 [, ChangeRecord2, … ]) Merge records Patch( Record1, Record2 [, …] )
upvoted 13 times
DeVries
2 years, 6 months ago
Last is 'no' because patch() with defaults() does not update but creates: https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-patch#overview "Use Patch with the Defaults function to create records. "
upvoted 4 times
...
...
KAL18
Highly Voted 2 years, 10 months ago
The usage of LookUp function is to find the first record in a table based upon certain criteria. So, the third answer should also be NO. Correct answers: YNNN
upvoted 12 times
KAL18
2 years, 9 months ago
Furthermore, (for question 3) >>> No need to use Lookup function to create reference to customer because the earlier Patch function already returns the generated customer ID. Reference >>> The return value of Patch is the record that you modified or created. If you created a record, the return value may include properties that the data source generated automatically. https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-patch#modify-or-create-a-record-in-a-data-source
upvoted 3 times
...
...
Juan0414
Most Recent 1 week, 2 days ago
Yes No No No
upvoted 1 times
...
loftuscheek
2 weeks, 3 days ago
gpt o3 high : YNNN
upvoted 1 times
loftuscheek
2 weeks, 3 days ago
2 explanation: Explanation: This statement simply creates a new receiver record by assigning SignedBy and SignedID. It does not create or store any reference to a package.
upvoted 1 times
loftuscheek
2 weeks, 3 days ago
3 explanation: Explanation: In the second Patch call, the app uses First(Result).SbsId to capture the identity (primary key) of the newly created receiver record. Because the Patch function in Power Apps returns the newly created record (including its identity column) to the Result collection, no additional lookup is required. You already have the correct SbsId to link the package.
upvoted 1 times
loftuscheek
2 weeks, 3 days ago
4 explanation: Explanation: When you use Defaults(Packages) in the Patch call, you are creating a new record rather than merging changes into an existing record. “Merging” would require specifying an existing record to update.
upvoted 1 times
...
...
...
...
Jons123son
3 months, 2 weeks ago
As always the whole set up + code does not make sense. The questions wording does not give enough information and leaves room for speculations.... 1. N -No SBsqlid is not included in the patch object. Further we do not know if SBsqlid is an auto populated primary key column or a foreign key. 2. N - Technically yes because SignedById should be a reference to the customer, but actually no because we do not know if it is true and if the customer already exists. 3. Y - Without checking for the customer we cannot be sure if the customer exists. Lookup customer by SignedById, if empty do something else because reference is missing. The reference to the receiver is worthless if the customer does not exist. 4. No - Default(Packages) creates a new package. There is no indication the a merge is required.
upvoted 2 times
OlenaChep
6 days, 6 hours ago
1) Defenetive Yes as an identity column in SQL is a column whose values are automatically generated when a new row is inserted into the table. This feature is commonly used to create unique identifiers for each row, often serving as the primary key.
upvoted 1 times
...
Jons123son
3 months, 2 weeks ago
For 1. Typo meant custom unique key instead of foreign key. So we do not know if SBsqlid values are generated by the system or of it just a unique column and requires unique informationen.
upvoted 1 times
...
...
amarrrin
11 months, 1 week ago
11-oct-2023 in the first option was also "line 03" note on exam.
upvoted 1 times
...
At09
11 months, 2 weeks ago
YNYN it is
upvoted 1 times
...
nivanpee
2 years, 8 months ago
answer should be YNYN
upvoted 11 times
...
etrifiro
2 years, 10 months ago
YYNN right?
upvoted 1 times
etrifiro
2 years, 10 months ago
please ignore this
upvoted 3 times
...
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago