cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Dual Super User
Dual Super User

Re: Autofill Manager, Team lead, Assistant Manager from ComboBoxes

@Agerde 

 

You are getting this error, maybe because your DataCardValue3 is a combobox control, which holds the records, rather than keeping a single value stored in Result/Value like dropdown. So you can modify your DefaultSelectedItem as :
 
[Office365Users.Manager(DataCardValue3.Selected.Mail).DisplayName]
 
Here the only change is to fetch the correct attribute from the main combobox, I don't know the name of your attribute, so I have placed "Mail" there, bacause mostly Office365 connectors use Mail. Please replace it with the attribute that holds value in your case. The powerapp will give a popup suggestion if you will just write "DataCardValue3.Selected.", then select the value and this should resolve your error.
 
Same could be done for the other two fields as well.
 
Hope this Helps!

View solution in original post

Agerde
Level: Powered On

Re: Autofill Manager, Team lead, Assistant Manager from ComboBoxes

@yashag2255 

 

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.

 

Employee:

(Combo Box) ---DataCardValue3

Team Lead:
(Combo Box) --- DataCardValue21

Assist. Manager:

(Combo Box) --- DataCardValue 28

Manager:

(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?

 

Agerde
Level: Powered On

Re: Autofill Manager, Team lead, Assistant Manager from ComboBoxes

I found a thread that contains a formula that helps with the error,

 

[If(!IsBlank(DataCardValue21.Selected.Email),Office365Users.Manager(DataCardValue21.Selected.Email).DisplayName)]

 

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.

Dual Super User
Dual Super User

Re: Autofill Manager, Team lead, Assistant Manager from ComboBoxes

@Agerde 

The problem here is:
 
Even if we select a default value in a combobox, it still does not set that as the selected, it shows the user that something has been selected but when you try to print it somewhere, it doesn't work. So mainly its just a viewable content.
 
If you want a workaround for this, you might want to setup a variable as soon as the value of your employee combobox is changed and use the variable instead of using the direct ThisItem.Email, you can set these variables, each for three different comboboxes, on the onChange property of Combobox1(Employee) and then use them in the respective combobox DefaultSelectedItems.
 
If you don't want to go with the above process, they maybe you can switch to a dropdown and this will resolve your issues in a single go.
 
Hope this Helps!
Agerde
Level: Powered On

Re: Autofill Manager, Team lead, Assistant Manager from ComboBoxes

@yashag2255 

 

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.

Dual Super User
Dual Super User

Re: Autofill Manager, Team lead, Assistant Manager from ComboBoxes

@Agerde 

 

You can add the variables on the OnChange property of Employee combobox, to set the email variable for all the three other comboboxes.
 
OnChange:
Set(EmployeeEmail, DataCardValue3.Selected.Mail)
Set(ManagerEmail, Office365Users.Manager(EmployeeEmail).Mail);
Set(AssistantManagerEmail, Office365Users.Manager(ManagerEmail).Mail);
Similar variable can be created for Team Lead.
 
Now, moving forward to the combobox's defalutSelectedItems, now instead of putting control values, you can input the variable that holds the email address of each required personal.
 
[Office365Users.Manager(EmployeeEmail).DisplayName] or
[Office365Users.Manager(ManagerEmail).DisplayName]

Please let me know in case you have any other issues.
 
Hope this Helps!
Agerde
Level: Powered On

Re: Autofill Manager, Team lead, Assistant Manager from ComboBoxes

@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!

Dual Super User
Dual Super User

Re: Autofill Manager, Team lead, Assistant Manager from ComboBoxes

Hey @Agerde Glad that it worked. Please post if you need any more assistance on this!

 

Thanks, 

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors (Last 30 Days)
Users online (5,444)