web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Dropdown items as a da...
Power Apps
Answered

Dropdown items as a data source list

(0) ShareShare
ReportReport
Posted on by 24

Hi,

I am trying to create a document search application based on sharepoint lists. I have three sharepoint list containing the reference to documents.  I want the user to select the list form the dropdown and then in gallery it will display that list data. 

I have add the name of the share point list in items of dropdown as  [ list one name, List 2 name, list three name].

Now when i use Dropdown.Selected.text it is not working. Below is the screen shot of the app

 

Thanks in advance for the help.

SMErrordrop down.JPG 

Categories:
  • Verified answer
    v-yangar-msft Profile Picture
    Microsoft Employee on at

    Hi @shoaibsam12 ,

     

    The reason for your error is that the value of Dropdown.Selected.text is “Text” which is from you SharePoint list but we don’t know which of the three lists it came from. Therefore you should use the judgment condition to make sure that when you select one of lists, the gallery will shows the corresponding content of selected SharePoint list.

     

    I have made a test on my side, please take a try the following workaround:

    1. Create 3 SharePoint lists named "showDoc","showDoc2" and "ShowDoc3".
    2. Add the three lists in your app as below:
    v-yangar-msft_0-1609999470778.png

     

    1. Add a Drop down control, and then set its Items property to this expression:

    ["showDoc","showDoc2","ShowDoc3"]

    1. Add a gallery and set its Items property to this expression(Because I don’t know what your detailedrequirement for using Filter, I’m assuming here that you want to Filters the SharePoint list data source for records in which the search string appears at the start of the Title column, if you have other requirements, pls feel free to let me know):

    Filter(Switch(Dropdown1.Selected.Value,"showDoc",showDoc,"showDoc2",showDoc2,"ShowDoc3",ShowDoc3),StartsWith(Title,TextInput2.Text))

    1. Add a text input control.
    2. The result as you see, when I choose showDoc2, the corresponding list content will be displayed in the gallery.
    v-yangar-msft_1-1609999470782.png

     

    Therefore, I advise you can refer to my expression in my test:

    Filter(Switch(Dropdown1.Selected.Value,"showDoc",showDoc,"showDoc2",showDoc2,"ShowDoc3",ShowDoc3),StartsWith(Title,TextInput2.Text))

     

    Hope it’s helpful!

     

    Best regards,

    Arrow

  • shoaibsam12 Profile Picture
    24 on at

    Thanks for the help, it worked to some extant. I used this formula based on two lists MPD Engineering reports and EOWR Register.

     
    Switch(
    Dropdown1.Selected.Value,
    "MPD Engineering Reports",
    Filter('MPD Engineering Reports',StartsWith('Author MER',TextInput2.Text)),
    "EOWR Register",
    Filter('EOWR Register',StartsWith('Author EOWR ',TextInput2.Text))
     
    )
     
    What i want next is: based on second dropdown, user can .select the column of the list. In above code i have selected author column , i want to make it dynamic based on 2nd drop down [" Author", "Client", Country"] .
     
    Apologies for putting in additional requirement.
     
    Regards
    SM
  • v-yangar-msft Profile Picture
    Microsoft Employee on at

    Hi @shoaibsam12  ,

     

    Welcome!

    Firstly, sorry for the delay. For your next query, you can realize it as below to make it dynamic based on 2nd drop down [" Author", "Client", Country"].

    1. In your above code, you have selected author column, if you want to make it dynamic based on 2nd drop down [" Author", "Client", Country"], you should add the judgement condition to choose which dynamic column you want to filter.

    Because you have 3 dynamic column,  I use two judgment condition in my code as below:

     Filter(Switch(Dropdown1.Selected.Value,"showDoc",showDoc,"showDoc2",showDoc2,"ShowDoc3",ShowDoc3),If(IsMatch(Dropdown2.Selected.Value,"Client"),StartsWith(Client,TextInput2.Text),If(IsMatch(Dropdown2.Selected.Value,"Country"),StartsWith(Country,TextInput2.Text),StartsWith(Author.DisplayName,TextInput2.Text))))

     

    Here is the result :

    v-yangar-msft_0-1610425783827.png

     

    When I choose ‘Client’ column, in the textput, it will search it based on ‘Client’, as you see, ‘saf’ is a record in ‘Client’.

     

    Hope it helps!

     

    Thanks,

    Arrow

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 352 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 323

#3
Mohsin Ali Profile Picture

Mohsin Ali 226

Last 30 days Overall leaderboard