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 / Datasource defined by ...
Power Apps
Answered

Datasource defined by variable

(0) ShareShare
ReportReport
Posted on by 308

HI

 

I have a datasource defined by formula: 

 

Switch(varGrupo;"Projeto"; ProjProjeto; "Plan"; PlanProjetos)

 

I want to define Item as galleryProjects.Selected but that is a error.

 

Is taht possible to set datasource this way? I

Categories:
  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @alessandramaced 

    You cannot dynamically change schemas of variables in PowerApps.  That would be more of a development type thing.  

    Instead consider setting two galleries, one with ProjProjeto and one with PlanProjects.  Then set the Visible of the two galleries as  varGrupo="Projecto" for the ProjProjeto one and varGrupo="Plan" for the plan one.

     

    I hope this is helpful for you.

  • Verified answer
    WarrenBelz Profile Picture
    156,750 Most Valuable Professional on at

    Hi @alessandramaced ,

    Assuming the field names and types are exactly the same on both lists, you may be able to do something like this

    Switch(
     varGrupo;
     "Projeto"; 
     LookUp(
     ProjProjeto;
     ID=GalleryName.Selected.ID
     ); 
     "Plan"; 
     LookUp( 
     PlanProjetos;
     ID=GalleryName.Selected.ID
     )
    )

     

    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.

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

#2
M Bilal Khan Profile Picture

M Bilal Khan 271

#3
Mohsin Ali Profile Picture

Mohsin Ali 223

Last 30 days Overall leaderboard