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

Autofill Manager, Team lead, Assistant Manager from ComboBoxes

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.

1 ACCEPTED SOLUTION

Accepted Solutions
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

17 REPLIES 17
Dual Super User
Dual Super User

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

Hi @Agerde , 

 

Try replacing DataCardValue3.SelectedItems.Text with DataCardValue3.Selected.Result and hopefully the error will get resolved. 
 
If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!
Agerde
Level: Powered On

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

Hey @yashag2255 , I tried that, it didn't work 😞 gave the same errors as the other way I had it unfortunately..

Dual Super User
Dual Super User

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

Hi @Agerde , 

 

Can you please give a shot to 

DefaultSelectedItems: [Office365Users.Manager(DataCardValue3.Selected.Result).DisplayName]
Office365Users.Manager(DataCardValue3.Selected.Result).DisplayName doesnot return a record, it returns a string, so we need to make it as a list to work 
 
If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!
Agerde
Level: Powered On

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

@yashag2255 

 

Am I supposed to change DefaultSelectedItems: to something different? Sorry, I am newer to PowerShell, but now the rest of it is saying it is ok, but the first portion is saying " Name isn't valid. This identifier isn't recognized"

Dual Super User
Dual Super User

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

@Agerde 

 

As per your scenario, you want to automatically select the Manager/Team Lead based on selected user and you are using combobox to the set the default value for it, we usually use the DefaultSelectedItems attribute. 
 
Please try to set the defaultSelectedItems in the combobox, and if it still doesn't work, please share the screenshot of the formula where you are getting the exact error, throught that we will be able to assist you better
Community Support Team
Community Support Team

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

Hi @Agerde 

 

What is the datasoure? SP list?

What is the column type of DataCardValue3,Person or other?

Could you please reference this

https://powerusers.microsoft.com/t5/General-Discussion/Display-Managers-Name-from-a-Person-or-Group-...

 

Hope this could be helpful.

 

Best Regards.

Yumia

 

Agerde
Level: Powered On

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

@yashag2255 

 

Yes. So I have a ComboBox ( which I am not sure is the correct choice) and I am filling comboboxes with the Team Lead, Assistant Manager and Manager of the agent from the Employee Combobox. I had them all set as combo boxes since the user was manually entering in the information at first, but I am trying to get it to AutoFill. If I need to change the type of box it is to get this to work I can. 

 

They are people picker fields, where you start typing in any and they are linked to our office365 employee list to find an employee. 

 

I have tried entering in a formula into the Default and defaultselecteditems boxes and get errors either way... 

Agerde
Level: Powered On

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

@v-yuxima-msft 

 

If I follow your link the only portion i get an error on in the Default field for the formula is the ").DisplayName" 

 

The error I get says Expected Table Value. I am noticing in the other persons screenshots his autofilling field is a text box and not a combobox, do I need to change my manager boxes to text boxes instead of combo to get this to work correctly?

Community Support Team
Community Support Team

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

Hi @Agerde 

 

Yes,you are right.

The link of the case I provide, the user uses one textinput or label to show the Manager Name,

So he uses the formula expression as 

Office365Users.Manager(DDName.Selected.Email).DisplayName

 

And what is the column type of your manager column and teamlead column?

 

However,if you use one control as ComboBox or other table type controls to accept the value,please try to 

change the formula expression which will output the table value,try to sub .DisplayName to test.

 

 

Best Regards.

Yumia

.

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 (6,237)