cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Oosterwijk
Level: Powered On

Mail address from Excel to user in variable

 I am adjusting the 'Leave Request' template. Everyone can choose their own approver in the template. I want to determine the approver for everyone.

 

I got an Excel table: 

 

          Mail address logged in person |   Mail address approver

row1:         

row2:

The power app formula must look in the excel file, find the current user and take the approver of it. Then the formula should look in Office365Users and put the entire user in a variable.

I already tried: 
Set(_defaultApprover;Office365Users.UserProfile(Table.Approver));;

But it isnt working. 

Mark_Dutton
Level: Powered On

Re: Mail address from Excel to user in variable

Hi @Oosterwijk,

 

To clarify: You wish to ignore the Manager that is Set to variable  _selectedApprover, yes?

 

BR, Mark

sandesh
Level: Power Up

Re: Mail address from Excel to user in variable

Hi Oosterwijk,

 

Here Office365Users.UserProfile() function is expecting value like single email address(sandesh@outlook.com), and it will return us the table of content, which will have details in our case like "Job Title", "Display Name", "Telephone" etc. So here we need to more specific while retrieving the required info.

For Example: 

  1. Office365Users.UserProfile(First('Table1').Email).displayName.
  2. Office365Users.UserProfile(First('Table1').Email).city ....etc.

I hope you got my point and let me know if you need any additional info on this.

 

Thank,

Sandesh

PauwelsSven
Level 8

Re: Mail address from Excel to user in variable

Hi,

 

Set(_User,Office365Users.UserProfileV2(Filter(Table, personloggedin = User().Email).Column))

 

Oosterwijk
Level: Powered On

Re: Mail address from Excel to user in variable

I thought this would work, but it gives me the following errors

Invalid Argument Type (Table) needs TEXT 
the function UserProfileV2 has some invalid arguments

this is my expression

                 VAR                                                                            Table        TableHead         UserInVar          TableHead

    Set(_defaultApprover; Office365Users.UserProfileV2(Filter(Balance; EmployeeEmail = _myProfile.Email).Approver)));

Highlighted
PauwelsSven
Level 8

Re: Mail address from Excel to user in variable

Hi,

 

Can there be more then 1 approver?

Can you ad a screenshot of the error?

 

Oosterwijk
Level: Powered On

Re: Mail address from Excel to user in variable

For each user can there be another approver... but one approver per user

Oosterwijk
Level: Powered On

Re: Mail address from Excel to user in variable

thisfunctionhas.PNG

Oosterwijk
Level: Powered On

Re: Mail address from Excel to user in variable

text.PNG

PauwelsSven
Level 8

Re: Mail address from Excel to user in variable

Hi, 

 

Try with First() aroud your filter statement.

 

Regards