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
Super User
Super User

@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
Super User
Super User

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
Super User
Super User

@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
PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

Top Solution Authors
Top Kudoed Authors
Users online (1,222)