cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
alessandramaced
Helper IV
Helper IV

Datasource defined by variable

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

1 ACCEPTED SOLUTION

Accepted Solutions
WarrenBelz
Super User III
Super User III

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.

View solution in original post

2 REPLIES 2
RandyHayes
Super User III
Super User III

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

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!
WarrenBelz
Super User III
Super User III

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.

View solution in original post

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

PowerPlatform 768x460.png

Microsoft Learn

Check out our new Discover Your Career Path blog post series and get all the details.

Users online (2,348)