Hi all,
I have SharePoint list called Employees and it contain below field;( these field are single line text and import from datavers using power automate. )
In canvas app, there are two drop down list called, opUnit(dropdown), Approver(dropdown)
Each dropdown list
opUnit ‘Items’ →District(‘Employees’, ‘Operation Unit’
Approver ‘items’ →District(‘Employees’, ‘Approver Name’
And I want to set their default selected item based on current user.
Ex: if current user equal to Full name, then it’s related values populate in drop down lists.
I tried someway but it didn’t worked properly. Hope your support.
Solved! Go to Solution.
Hi @ShriniA,
Okay, so it is a canvas app for Teams, right?
You mean the options display correct, however it displays nothing within the Combo Box, right?
Try to select the edit icon on the right pane of the fields, select the Result field name for the Combo Box.
Then you should modify your formula as below:
Filter(Distinct(Employees,‘Operation Unit’),Result=LookUp('KIT2.0_HR Data',Lower(currentuser)='Emailxxxx').‘Operation Unit’)
Modify your Filter() function as LookUp() function but keep the content within.
The key to this issue is that you set the Items property with a Result column table returned by Distinct() function, so you need to filter within the Result table rather than your data source.
You can use User().FullName or User().Email to get the logged in user.
Hi,
If you have a drop down then you can use below formula in Default property of Operation Unit
LookUp(Employees, Lower(Email) = Lower(User().Email), 'Operating Unit')
I would suggest you to go for email
I got error in this formula.
I used LookUp(Employees, Lower(emailaddress) = Lower(User().Email),’Operating Unit’)
This emailaddress is column name of Employees table Email.
Hi @ShriniA,
Do you want to populate the Combo Box with corresponding user if the current user has the same full name with it exists in the Full Name column?
The DefaultSelectedItems property expect table value, so you should set it as below:
Filter('Employees',User().FullName='Full Name').'Operation Unit'
Filter('Employees',User().FullName='Full Name').'Approver Name'
Your query is worked but it doesn’t appear in dropdown field. I have no idea why it’s not appear in dropdown field.I checked it and get correct value.
Hi @ShriniA,
Could you please provide some screenshots to describe your scenario?
Where do you have theses Combo Boxes and how you set the Item property of them?
Please do provide some detailed screenshots about controls or anything else makes sense.
Here is the screenshot.
items →District(‘Employees’, ‘Operation Unit’)
Dropdown list have correct items when apps play.
Hi @ShriniA,
Okay, so it is a canvas app for Teams, right?
You mean the options display correct, however it displays nothing within the Combo Box, right?
Try to select the edit icon on the right pane of the fields, select the Result field name for the Combo Box.
Then you should modify your formula as below:
Filter(Distinct(Employees,‘Operation Unit’),Result=LookUp('KIT2.0_HR Data',Lower(currentuser)='Emailxxxx').‘Operation Unit’)
Modify your Filter() function as LookUp() function but keep the content within.
The key to this issue is that you set the Items property with a Result column table returned by Distinct() function, so you need to filter within the Result table rather than your data source.