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 / Drop down list in canv...
Power Apps
Unanswered

Drop down list in canvas app to change data source

(0) ShareShare
ReportReport
Posted on by 63

Hi all.

 

I have created a simple canvas app from a SharePoint list.

 

I plan to create approximately 30 lists, all the columns will be formatted the same across the lists. The only thing to change will be the item entries which will differ between the sites.

 

I don't want to create 30 apps, one for each site, what I want to do is create a drop down box where the auditor / user selects the location (the location will be the list name). Once selected the app updates the item entries to reflect the list selected.

 

Is this possible, I am new to powerapps.

 

Tia.

 

 

 

 

Categories:
  • mdevaney Profile Picture
    29,993 Moderator on at

    @MarkB1977 

    It is possible, but it does create a fair amount of work for you to implement/maintain.

     

    • Everytime a new SP list is added the owner of the app must add the connection.
    • Additionally, new code will need to be written to support it.
    • All lists must have exactly the same columns & column names. 

     

    If you can adhere to those basic requirements it is possible: it will require heavy use of collections and the patch function though.  You haven't explained what your app does though so I can't really comment further.  I can help with a high-level overview and respond to questions but I doubt I'll be able to give a complete solution on the forums.

     

    ---
    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."

  • MarkB1977 Profile Picture
    63 on at

    @mdevaney 

     

    • Everytime a new SP list is added the owner of the app must add the connection.  - No problem with this I have added the second test list data source in already. 
    • Additionally, new code will need to be written to support it. - My coding is limited but once I have 2 lists working, I should be fine to duplicate.
    • All lists must have exactly the same columns & column names. - They will be, the data gathered remains the same.

     

     

    Basically the app will be used on a mobile device to capture information during an audit of a property.

     

    For example, Each list item is a question IE - Is there a First Aid kit in place and is it adequately stocked? 

     

    From the main gallery page (where these list items (or questions) are displayed the user taps the RHS to the second page which gives a more detailed view of the question and current answers.  From there they can click to the final page to edit the list item entry.

     

     

    The columns are in brief are below and remain static for all locations.

     

    Title (used as the question)

    completed Y/N

    Date of last inspection

    Date of next inspection

    Days to next inspection (calculated)

    Compliant? (calculated)

    Image (URL to be copied from attachments)

    Site comments

    Completed by

    Score (calculated)

    Number of attachments (calculated)

     

    Screenshot_20200330_172431_com.microsoft.msapps.jpgScreenshot_20200330_172440_com.microsoft.msapps.jpgScreenshot_20200330_172445_com.microsoft.msapps.jpg

     

     

     

     

     

  • mdevaney Profile Picture
    29,993 Moderator on at

    @MarkB1977 
    Question: are you creating a new SharePoint list each time there is a new audit?  I am trying to understand your rationale for having 30 SP lists.

  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    Hi @MarkB1977 

    If all of the lists have exactly the same columns, then why not just add another column that identifies the Site.  Then you could filter your list by site. 

  • MarkB1977 Profile Picture
    63 on at

    @mdevaney 

     

    There are 30 office locations we audit, each have their own specific set of list items (questions).

     

    I need to be able to show the audit (or completed lists) to external parties.

     

    I have added a test data source list and can switch between the gallery data source and the information pulls through perfectly.

     

    If there was a way I could say add an initial screen so when the app is opened the user selects the location (which is the SP list) and that data source is selected I would be winning.

     

     

  • MarkB1977 Profile Picture
    63 on at

    @Drrickryp 

     

    This is an option I hadn't considered!

     

    I will have a look at this tomorrow and see if it works for me.

     

     

  • mdevaney Profile Picture
    29,993 Moderator on at

    @MarkB1977 

    For this task I would recommend an approach that requires only 2 SharePoint lists.  This was why I was asking so many questions to understand your app, lol.

     

    QuestionsSPList

     

    LocationID (Text) QuestionNumber (Text) QuestionText (Text)
    S0001 1 "Question here 1a"
    S0001 2 "Question here 2a"
    S0001 3 "Question here 3a"
    S0002 1 "Question here 1b"
    S0002 2 "Question here 2b"

     

    ResponsesSPList

    AuditID (Text) LocationID (Text) QuestionID (LookUp) QuestionText (LookUp) Response (Text)
    A0001 S0001 1  "Question here 1a" "Response"
    A0001 S0001 2  "Question here 1b" "Response"
    A0001 S0001 3  "Question here 1c" "Response"
    A0002 S0001 1  "Question here 1a" "Response"
    A0002 S0001 2  "Question here 1b" "Response"
    A0002 S0001 3  "Question here 1c" "Response"

     

    ---
    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."

  • mdevaney Profile Picture
    29,993 Moderator on at

    @Drrickryp 
    Agreed.  It looks like we both had the same basic idea.

  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    Hi @MarkB1977 

    If you do take my suggestion, make a separate list of sites and in the original list, create a new number column called siteID and use the ID from the Site list to identify the Site.  I recommend NOT creating the column as a lookup type in SharePoint as this could be more complicated to deal with in PowerApps. 

    For a more complete explanation of why @mdevaney and I have the same approach, check out my series on database design at https://powerusers.microsoft.com/t5/News-Announcements/Database-Design-Fundamentals-and-PowerApps-An-Overview/ba-p/184485  and in particular the third part of the series that talks about the tables and relationships and why I prefer not to use SharePoint lookups. 

  • mdevaney Profile Picture
    29,993 Moderator on at

    @Drrickryp 
    Yeah, those LOOKUP columns are great in SharePoint but a pain in PowerApps...  Ditto for Yes/No columns.

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 397 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 354

#3
WarrenBelz Profile Picture

WarrenBelz 232 Most Valuable Professional

Last 30 days Overall leaderboard