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

Select dropdown based on sharepoint list value

Hi All,

 

I'm having some trouble with a solution that i would like to implement.

 

So: I have a dropdown  connected to a sharepoint list

 

Sharepointlist (Dedikaltkocsik) content:  Title  -  Name  - Email

 

The dropdownlist items should be the content of the column  "Title"

 

But i would like to have the default selected value to be the item where Dedkialtkocsik.Email=User().Email (othercase let's say the 1st element of the list)

 

I've tried filtering, choices ....etc but with now result, probably the sintax of my formula wasn't good. Can anyone help?ű

 

Thank you in advance!

1 ACCEPTED SOLUTION

Accepted Solutions
WarrenBelz
Level 8

Re: Select dropdown based on sharepoint list value

Hello @OliverV ,

@mdevaney is on the correct path here.

Without seeing your app, I don't know the exact issue, however I will suggest a bit of a more robust approach and see if it works.

Firstly, at App OnStart, set a global Variable for the Users' email - this also gets around delegation issues with User().Email

Set(vUserMail, Lower(User().Email))

Now in the Default of the DropDown try (I assume the email addresses are in ItemList.Title)

LookUp(
    ItemList,
    Lower(Title) = vUserMail,
    Title
)

 This should populate the field with the user's email, providing it is in the list.

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

View solution in original post

11 REPLIES 11
Super User
Super User

Re: Select dropdown based on sharepoint list value

@OliverV 

Is your dropdown part of an Edit Form?  Is Email a single line text field?  Are you using a dropdown and not a ComboBox?

 

Please try this code in the Default property.  Your user's email must appear in the dropdown already for this to work.

 

User().Email

 

 

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

OliverV
Level: Powered On

Re: Select dropdown based on sharepoint list value

Hello ,

 

So this is what i have.

 

PowerAPP ( a simple dropdown input, not part of an edit form). (1st picture)

 

A sharepoint list with 3 Elements (2nd picture) (let's call the list  "Itemlist")

 
 

In the dropdown the Items should be:  Distinct(Itemlist;Title)

 

What i would like to achieve is the Dropdown Default attribute to be selected based on who is using the application, so if they want to use the items assigned to them they don't need to search in the drop down, but allow them to have free hand on chosing between the other items too.

 

the List  Email column would be = to the Office365 user with which they use the application.

 

I hope like this I was a bit more clear. 🙂

 

btw thx for the previous quick reaction !

Super User
Super User

Re: Select dropdown based on sharepoint list value

@OliverV 

Did you try my suggestion?  What happened when you tried it?

OliverV
Level: Powered On

Re: Select dropdown based on sharepoint list value

Hello,

 

I've tried it but nothing happens shows simply the list sorted aplhabetically unfortunately

WarrenBelz
Level 8

Re: Select dropdown based on sharepoint list value

Hello @OliverV ,

@mdevaney is on the correct path here.

Without seeing your app, I don't know the exact issue, however I will suggest a bit of a more robust approach and see if it works.

Firstly, at App OnStart, set a global Variable for the Users' email - this also gets around delegation issues with User().Email

Set(vUserMail, Lower(User().Email))

Now in the Default of the DropDown try (I assume the email addresses are in ItemList.Title)

LookUp(
    ItemList,
    Lower(Title) = vUserMail,
    Title
)

 This should populate the field with the user's email, providing it is in the list.

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

View solution in original post

OliverV
Level: Powered On

Re: Select dropdown based on sharepoint list value

Hello Warren;

Like this now it worked !!!!!! 😄 i did only a small change on the function that u wrote. Final solution:

Dropdown items = Distinct(itemlist;Title)
Dropdown Default=

LookUp(
    ItemList,
    Lower(Email) = User().Email,
    Title
)
WarrenBelz
Level 8

Re: Select dropdown based on sharepoint list value

That's great Oliver

 

I would still suggest you consider using the Variable - User().xxx is not a Delegable query and I have given up doing anything other than setting Global variables on App OnStart for both User().Email and User().FullName.

The Lower part is precaution for case sensitive emails - it generally works without it but for a non-risk solution use

Lower(Email) = Lower(User().Email)

 

OliverV
Level: Powered On

Re: Select dropdown based on sharepoint list value

Hello Warren,

U are 100% right. I'm mainly a BI consultant, and forgot the nr.1 rule "pay attention to data quality" :D. I've added the "lower" also to the other mail, so it will be for sure FoolProof. Again 100 Thx!!!!!

now I'm missing only a last feature for having my idea totally done, and it's one single picture module that changes based on the selected item. Thinking about Sharepoint library with images loaded in VS the "Itemlist" sharepoint list with attachement.

 

WarrenBelz
Level 8

Re: Select dropdown based on sharepoint list value

OK @OliverV ,

You want to put the user's photo based on the email address in the drop-down.

If you post this to a new thread when you are ready and tag me, I have a staff list that does exactly this - based on name, but the principle is the same. It also works on mobile devices.

Helpful resources

Announcements
Better Together’ Contest Finalists Announced!

'Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

thirdimage

Power Apps Community User Group Member Badge

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

sixthImage

Join THE global Microsoft Power Platform event series

Attend for two days of expert-led learning and innovation on topics like AI and Analytics, powered by Dynamic Communities

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

thirdimage

Microsoft Business Applications Virtual Launch

Join us for the Microsoft Business Applications Virtual Launch Event on Thursday, April 2, 2020, at 8:00 AM PST.

thirdimage

Community Summit North America

Innovate, Collaborate, Grow - The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (8,295)