I am trying to AutoFill boxes and auto send an email to the manager / Team Lead upon form submission.
I am getting errors all the time...
Currently I am trying to type: Office365Users.Manager(DataCardValue3.SelectedItems.Text).DisplayName
The entire thing gets an error. The first says that "Manager has an invalid function. ".Text" is a wrong Identifier. and "DisplayName" Expected Record Value.
I can't find other answers I have looked....
DataCardValue3 is the name of the First Dropdown box in my form which is where a user will input the Employee name that I need the manager, team lead and assistant manager of. The Card name is Employee_DataCard1.
Any help is appreciated.
Solved! Go to Solution.
Voila!! it works. For the Team lead one. If I try to then take the formula down to the next combobox in the series for the Assistant Manager it gives an error.
Here, I have the 4 combo boxes in order.
(Combo Box) ---DataCardValue3
(Combo Box) --- DataCardValue21
(Combo Box) --- DataCardValue 28
(Combo Box) --- DataCardValue13
The only way I can figure it out is I input the [Office365Users.Manager(DataCardValue3.Selected.Email).DisplayName] into the Team Lead Combo Box and it filled in the Team Lead, NOT the Employee Manager.
So I figured I would need to input [Office365Users.Manager(DataCardValue21.Selected.Email).DisplayName] into the DefaultSelectedItems spot of the Assistant Manager to then get the Assistant Manager of the Team lead.
But I get an error stating " The Method 'Manager' has an invalid value for parameter 'userID'" WHich I think means it is not seeing the Team lead name now to pull the Assistant manager?
I found a thread that contains a formula that helps with the error,
This makes it so there is no error, however, it does not populate a name into the Assistant Manager Field still. I am still going through and researching to find a fix.
I am going to try this. I really want to learn powerapps more, we previously used InfoPath in our work but it is becoming obselete so trying to teach myself PowerApps...
So, where do I set the variable exactly? on the Employee OnChange? or on each of them individually?
Right now, on the OnChange for Team Lead - DataCardValue21, I have Set(TeamLead,DataCardValue21.Selected)
Then on the Assistant Manager Field - DataCardValue28, I have in the DefaultSelectedItems Box, [If(!IsBlank(TeamLead.Email),Office365Users.Manager(TeamLead.Email).DisplayName)]. I am getting no errors, but it is not populating anything. I keep trying to look for things on this forum board and other google lists, but I am not failing... I really appreciate ALL your help with this as I am new. Thank you thank you.
Set(EmployeeEmail, DataCardValue3.Selected.Mail) Set(ManagerEmail, Office365Users.Manager(EmployeeEmail).Mail); Set(AssistantManagerEmail, Office365Users.Manager(ManagerEmail).Mail);
@yashag2255 you sir!!!! Are my Hero! I thought that is how you meant to do it, but I think I kept typing it in slightly wrong and it was not allowing me to set variables that way. This worked! I'd hug you if I could!
I tried pretty much all day yesterday rearranging things and couldn't get it, hopefully if I keep at it. I'll get to your skill here.
Now off to make a submit button on the bottom of my form to send an email to those 3 Managers for the employee once form is submitted. Thank you again sir!
Learn how to create your own user groups today!
Check out the new Power Platform Community Connections gallery!
Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.