exam questions

Exam PL-500 All Questions

View all questions & answers for the PL-500 exam

Exam PL-500 topic 2 question 14 discussion

Actual exam question from Microsoft's PL-500
Question #: 8
Topic #: 2
[All PL-500 Questions]

HOTSPOT -

You are developing a cloud flow.

You write expressions for the following JSON object. (Line numbers are included for reference only.)



The flow parses JSON data by using the following schema:



For each of the following statements, select Yes if the statement is true. Otherwise, select No.

NOTE: Each correct selection is worth one point.

Show Suggested Answer Hide Answer
Suggested Answer:

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
Anuvind
Highly Voted 2 years, 1 month ago
i thik only 4th one is True. the 3rd one is incorrect - cannot be evaluated because array index '2' is outside bounds (0, 1) of array
upvoted 13 times
lauramacau
2 years ago
I agree. I've tested on power automate and it returned me an error
upvoted 1 times
...
...
Cegebe
Highly Voted 1 year, 9 months ago
Be careful and check how the expressions are written and test them in Power Automate. NO - It throws an error because is missing the question mark between body(Parse_JSON) and ['customerName']. It would work if written correctly even though there isn't customerName. NO - It outputs ": 10091" NO - Position 2 doesn't exist, only 0 and 1. YES - It works even if you omit the last question mark between customerPhones and position.
upvoted 9 times
Cegebe
1 year, 9 months ago
Correction on the second answer: The output of the concat is an error if using body('Parse_JSON').customerName as written in the question. The error specifies that customerName doesn't exist. As a curiosity, if using body('Parse_JSON')?['customerName'] it doesn't throw any error and the output is ": 10091". Answer is still NO, but I find interesting the two different outputs.
upvoted 1 times
devoprevo
1 year, 9 months ago
Cegebe is 100% correct on all of these. it won't throw the error if you include the '?' because that tells power automate to ignore the property if it doesn't exist, so the flow will execute successfully.
upvoted 2 times
...
...
...
GermanGerman
Most Recent 5 months, 3 weeks ago
My take is the following: No - because customerName does not exist No- because if the concat function does not fail it should result in ': 10091' Yes- because of the equals(!!) function. While parsing customerPhones[2] will return null or blank, it is compared to an empty string ''. So it could return true, assuming that null and '' are being regarded the same thing Yes - because the value for customerPhones[1] exists, and is parsed to integer
upvoted 1 times
...
JuanPuello
11 months, 1 week ago
With this I learnt some things: - You can call properties using dot notation "body('Parse_JSON').customerNumber" - The "?" is not mandatory to be present when calling a property. For example: "body('Parse_JSON')?['customerName']" also can be "body('Parse_JSON')['customerName']". The difference is that the "?" indicates Power Automate to ignore the error if the property does not exist in the object. - You can also use "?" before calling an item from an array, so for example if the third expression would have had "customerPhones?[2]", it would have not failed - You can use "?" with dot notation. So, from all of that the answer is: - No: The expression throws an error because the "customerName" property is not present. - No: The expression throws an error because "customerName" property is not present. - No: The expression throws an error because the index is out of the array. - Yes
upvoted 4 times
...
No No No Yes
upvoted 1 times
...
Mail20
1 year, 3 months ago
Yes No No Yes
upvoted 2 times
...
bobbySmurda
1 year, 10 months ago
YES, NO, NO, YES
upvoted 1 times
...
alejoRZ96
2 years ago
I created an instant flow with a variable with the Json, then the Parse JSON and a compose. The result was (True, : 10091, False, 114456129), which means ( Yes, No, No, Yes)
upvoted 4 times
...
charles879987
2 years ago
yes. correct. customerName are empty or null no. returns :10091 no. customerPhones[2] array index out of bound yes correct
upvoted 3 times
Anuvind
2 years ago
The first case. - there is no customerName in the expressions
upvoted 1 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