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

Getting the User's department using Office365Users.ManagerV2(DataCardValue6.Selected.Email).department and set it as the default value for dropdown will raise this error "Expected Record Value"

I have a dropdown list which contains all the departments inside our AD, then inside our form, i disable the department dropdown and i want to auto populate it with the Office365Users.ManagerV2(DataCardValue6.Selected.Email).department, but when i tried the below i got an error "Expected Record Value":-

 

ddddddddddd.png

1 ACCEPTED SOLUTION

Accepted Solutions
rsaikrishna
Community Champion
Community Champion

@johnjohn123 

 

What is the Items property value for Department dropdown? This is collection of values.

 

Office365Users.ManagerV2(DataCardValue6.Selected.Email).department is a single value. You are trying to place a text value into a table of values. Due to that, you see the error.

 

Give a try with following:

LookUp(<Drop down items property formula>,Value=Office365Users.ManagerV2(DataCardValue6.Selected.Email).department)

 

Regards

Krishna Rachakonda

If this reply helped you to solve the issue, please mark the post as Accepted SolutionMarking this post as Accepted Solution, will help many other users to use this post to solve same or similar issue without re-posting the issue in the group. Saves a lot of time for everyone.

 

View solution in original post

9 REPLIES 9
happyume
Solution Sage
Solution Sage

The syntax of Office365Users.ManagerV2("abc@domain.com").department is correct and will give you a single line of text.

 

Can you just select DataCardValue6.Selected.Email and confirm that you are getting the email address as expected?

rsaikrishna
Community Champion
Community Champion

@johnjohn123 

 

What is the Items property value for Department dropdown? This is collection of values.

 

Office365Users.ManagerV2(DataCardValue6.Selected.Email).department is a single value. You are trying to place a text value into a table of values. Due to that, you see the error.

 

Give a try with following:

LookUp(<Drop down items property formula>,Value=Office365Users.ManagerV2(DataCardValue6.Selected.Email).department)

 

Regards

Krishna Rachakonda

If this reply helped you to solve the issue, please mark the post as Accepted SolutionMarking this post as Accepted Solution, will help many other users to use this post to solve same or similar issue without re-posting the issue in the group. Saves a lot of time for everyone.

 

Digital
Super User
Super User

Check you if your  formula returns a table value. If that's the case try:

 

First(Office365Users.ManagerV2(DataCardValue6.Selected.Email)).department

 

@rsaikrishna  the items are:-

 

items.png

@Digitalsame error when i used :-

 

First(Office365Users.ManagerV2(DataCardValue6.Selected.Email)).department

@rsaikrishna  i tried this but got an error "Name is not valid":-

 

lookup.png

@rsaikrishnanow i tried this also:-

 

parent.pngwhere i did not get any error... but at the same time no dropdown option will get selected, it will stay blank..

johnjohn123
Super User
Super User

@rsaikrishnayour formula worked for me:-

 

parent.png

 

seems the SharePoint dropdown were missing some options.. thanks

StalinPonnusamy
Super User
Super User

Hi @johnjohn123

 

Set the Default Property of Department Dropdown to

Office365Users.ManagerV2(DataCardValue6.Selected.Email).department

 

StalinPonnusamy_1-1632114457220.png

 

 

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (5,261)