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 / Conditionnal datasourc...
Power Apps
Answered

Conditionnal datasource for a gallery

(0) ShareShare
ReportReport
Posted on by 4

Hello

 

I'm Julien, new to both this forum, and power Apps.

I'm currently building my first app and my question is the following:

 

Is there a way to make some kind of "conditionnal datasource" (Sharepoint list in my case) for a gallery?

What I would like is to select on the welcome screen on which project the user is working (each project being associated to a dedicated Sharepoint list to keep reasonnable the size of each list), and to have all the galleries of all the other screens linked to the specific list of the selected project.

 

I hope my explanations are understandable!

 

Thank you very much for your help.

 

Julien

 

Categories:
I have the same question (0)
  • markinwaukesha Profile Picture
    96 on at

    I like using collections and based on what datasource you want to use, you can have conditional logic and populate that collection and use it for items on the gallery. 

     

  • v-qiaqi@microsoft.com Profile Picture
    Microsoft Employee on at

    Hi @Julien_Delorme,

    Do you want to select a project name and navigate users to task screen inlucding a special list gallery?

     

    If so, you need to try as below.

    1). Populate the dropdown control with different project name like

    ["Project1","Project2","Project3"]
    

    2). Try to add a navigate button and set its OnSelect property as

    If(dd_project.Selected.Value="Project1",Navigate(ScreenProject1),
     dd_project.Selected.Value="Project2",Navigate(ScreenProject2),
     dd_project.Selected.Value="Project3",Navigate(ScreenProject3)
    )

     

  • JD-19081230-0 Profile Picture
    4 on at

    Hi Qi and Markinwaukesha,

     

    Thanks for you answers
    In fact what I would like is to avoid to have to add a new screen to the app everytime we start a project with a new customer (roughly every 3 months).
    What i imagine is:

    • 1 list with the projects names, allowing the selection of the project with a dropdown on the welcome screen
    • 1 list per projects with all data specific to this project
    • 1 single screen displaying with a gallery the data of the project selected on the welcome screen

    So the question is really: can one single gallery, on one single screen, display data from different lists according a condition defined somewhere else? (the condition being the list associated to the selected project on the welcome screen).

     

    Hope it's more clear now.

    Thanks for your help

    Julien

     

  • Verified answer
    v-qiaqi@microsoft.com Profile Picture
    Microsoft Employee on at

    Hi @Julien_Delorme,

    Not sure how you configure other lists with project name, I think I have mentioned the solution in my previous reply, you need to hard code this.

     

    The solution is just like the way I mentioned, you just need to populate the dropdown with the column you store the project names, like 

    list_name.ProjectName

    Then, write an if statement in your Gallery:

    If(dd_project.Selected.Value="Project1",list_Project1,
     dd_project.Selected.Value="Project2",list_Project2,
     dd_project.Selected.Value="Project3",list_Project3
    )

     

  • JD-19081230-0 Profile Picture
    4 on at

    Hello,

     

    Thanks for your answer.
    The thing is, with that approach, i will have to modify the IF() formula everytime a new project is starting since i don't know the project name in advance: this is what i wanted to avoid.

     

    Any other idea to avoid it?

     

    Thank you

     

    Julien

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 Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Valantis Profile Picture

Valantis 483

#2
WarrenBelz Profile Picture

WarrenBelz 399 Most Valuable Professional

#3
11manish Profile Picture

11manish 327

Last 30 days Overall leaderboard