PL-400 · Question #391
PL-400 Question #391: Real Exam Question with Answer & Explanation
The correct answer is A: Left(Param("recordId"), Find("|", Param("recordId")) - 1). To extract two distinct parts of a concatenated string delimited by a pipe symbol in Power Apps, use Left() with Find() to get the portion before the delimiter and Right() with Len() and Find() to get the portion after it.
Question
You create a custom page that is used as a contextual dialog in a model-driven app. The app must be able to receive two contextual parameters by passing a concatenated string. The string must use the pipe (|) symbol with the recordId parameter. You need to compose the formulas to extract parameter information. Which two formulas should you compose? Each correct answer presents part of the solution. NOTE: Each correct selection is worth one point.
Options
- ALeft(Param("recordId"), Find("|", Param("recordId")) - 1)
- BLeft(Param("recordId"), Len(Param("recordId")) - Find("|", Param("recordId")))
- CRight(Param("recordId"), Len(Param("recordId")) - Find("|", Param("recordId")))
- DRight(Param("recordId"), Find("|", Param("recordId")) - 1)
Explanation
To extract two distinct parts of a concatenated string delimited by a pipe symbol in Power Apps, use Left() with Find() to get the portion before the delimiter and Right() with Len() and Find() to get the portion after it.
Common mistakes.
- B. This formula
Left(Param("recordId"), Len(Param("recordId")) - Find("|", Param("recordId")))would extract a substring from the left, but its length calculation (total length minus delimiter position) is incorrect for isolating the first segment without the delimiter. - D. This formula
Right(Param("recordId"), Find("|", Param("recordId")) - 1)would extract a substring from the right, but its length calculation (delimiter position minus 1) is incorrect for isolating the entire second segment of the string.
Concept tested. Power Apps string manipulation (Left, Right, Find, Len)
Reference. https://learn.microsoft.com/en-us/power-platform/power-fx/reference/function-left-mid-right
Community Discussion
No community discussion yet for this question.