A lookup is a solution for this, but in PowerApps, not in SharePoint. Here's how you would go about implementing this:
- On the RequestList list on SharePoint, select the "PowerApps -> Customize forms" option that will bring you to the form in the PowerApps Studio (web editor).
- Add a new data source (in the ribbon, View -> Data sources -> Add data source), that references the ApproverList list on the same SharePoint site
- Select the card that represents the approver field in the list (it will likely be called
Approver_DataCard1
or something similar)
- In the right-side pane, select the 'Advanced' tab, and click the padlock that says "Unlock to change properties"
Now we can start updating the properties that will perform the lookup. Click the "More options" button to show all properties of the card, and search for Default
. Set its value to
If
IsBlank(DataCardValue3.Selected),
Blank(),
LookUp(
ApproverList,
Employee.Email = DataCardValue3.Selected.Email,
ApprovingManager))
Where DataCardValue3
is the name of the control (a combo box control) that is used to select the employee for who the request is being made.
Now every time the employee is changed, it will look at the ApproverList on SharePoint for an employee whose e-mail is the same as the one for the selected employee.
If you don't want to give the form user the option to override the default approver, you can also update the DisplayMode
property of the data card for the approver to DisplayMode.View
so that it will only show the approver to the user, without letting them change it.
Hope this helps!