PL-400 · Question #391
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 correct answer is A. Left(Param("recordId"), Find("|", Param("recordId")) - 1) C. Right(Param("recordId"), Len(Param("recordId")) - Find("|", Param("recordId"))). 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
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)
How the community answered
(35 responses)- A77% (27)
- B6% (2)
- D17% (6)
Why each option
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.
The `Left(Param("recordId"), Find("|", Param("recordId")) - 1)` formula correctly extracts the first part of the string by finding the position of the pipe symbol and then taking all characters to its left, excluding the pipe itself.
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.
The `Right(Param("recordId"), Len(Param("recordId")) - Find("|", Param("recordId")))` formula accurately extracts the second part of the string by calculating the length of the substring to the right of the pipe symbol and returning those characters.
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)
Source: https://learn.microsoft.com/en-us/power-platform/power-fx/reference/function-left-mid-right
Community Discussion
No community discussion yet for this question.