exam questions

Exam PL-100 All Questions

View all questions & answers for the PL-100 exam

Exam PL-100 topic 3 question 24 discussion

Actual exam question from Microsoft's PL-100
Question #: 24
Topic #: 3
[All PL-100 Questions]

HOTSPOT -
You are creating a Power Automate flow.
You have an array that contains items with different color attributes. You plan to filter the array by using the following filter expression within the flow:
@or(equals(item()?['color'], 'red'),contains(item()?['color'],'blue'))
The filter returns results only when the expression resolves to true.
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:
Box 1: No -

Box 2: Yes -
The item color must be red, or item color contains blue.
Box 3: Yes

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
daporh
Highly Voted 4 years ago
Correct!
upvoted 27 times
wfrf92
4 years ago
last one should be NO - it should be blue not sky blue
upvoted 11 times
ChrisF96
4 years ago
The formula has contains before blue so it should pull out any colours that have blue in the name
upvoted 15 times
Jekkie
4 years ago
You're right, I missed the 'contains' statement halfway through the formula. So the last one is indeed YES
upvoted 7 times
...
...
Jekkie
4 years ago
Indeed, if the filter stated 'contains' instead of 'equals' than it does yield a result...but in this case it is indeed NO.
upvoted 1 times
...
...
...
Edriska
Most Recent 1 year, 8 months ago
Certainly, let's analyze each question statement with the provided code: "The filter expression yields a result if the array contains the color orange." (No) The code doesn't check for the color 'orange' specifically, so it won't yield a result for the color 'orange'. "The filter expression yields a result if the array contains the color red." (Yes) The code checks if the 'color' property is equal to 'red', so it will yield a result for items with the color 'red'. "The filter expression yields a result if the array contains the color sky blue." (Yes) The code checks if the 'color' property contains 'blue', so it will yield a result for items with the color 'sky blue' or any color that contains 'blue'.
upvoted 2 times
...
VickyHindlekar
1 year, 9 months ago
Ans should be No No, No 1- In provided filter there is no Orange color mention. So it should be NO 2- It says contains the Red but in filter it is checking for equals Red. So it should be NO 3- It says contains Sky Blue but in filter it is Blue. So it should be NO
upvoted 1 times
...
Maery
2 years ago
The second one shouldn't be "No," as the condition equals Red, not containing Red. The answer
upvoted 1 times
...
Sri2020
2 years, 1 month ago
correct
upvoted 1 times
...
PassTheNOS
2 years, 11 months ago
Tested in a flow and this is correct. The result I got was: [ { "color": "red" }, { "color": "sky blue" } ]
upvoted 2 times
...
moserose
3 years ago
Correct answers
upvoted 1 times
...
Dude
3 years, 6 months ago
This answer is correct. At first I thought it was wrong until I noticed the key word, "contains" in the expression. Sky blue does CONTAIN the word Blue and thus the result would be true.
upvoted 3 times
...
ShawM
3 years, 9 months ago
In my opinion, should be NO, NO, YES
upvoted 2 times
ShawM
3 years, 9 months ago
sorry, i wrote wrong. The answer whould be NO, YES, YES.
upvoted 1 times
...
...
Easybake
3 years, 9 months ago
Shouldn't it be 'No', 'No', 'Yes'? If the array only *contains* red but is not 'equal' to red, the expression should not return anything. Right? Similar to the 'sky blue' situation. E.g.: if the colour is 'dark red' the expression will not return anything, since it wants values strictly equal to 'red'.
upvoted 2 times
MatheusMM
3 years, 8 months ago
I believe the idea is that one item is 'red', not that 'red' is part of a string within one of the items.
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 ...