cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Oos
Advocate V
Advocate V

1 form for multiple datasources.

I want to realize one powerapp based on an existing Sharepoint environment. In this SP environment there are about 12 exactly the same lists. 

I have one gallery on a screen and, based on a user's choice, he chooses from which DataSource (so which list) he should display the items. When you click on an item in the gallery, an edit form must be visible. In my gallery in PowerApps i have the following formula
OnSelect: Set(EditThisItem; ThisItem).

But the Form doesnt recognize ThisItem because of the multiple dataSources.
Is this possible? Or do i have to create for each datasource one form?

 

1 ACCEPTED SOLUTION

Accepted Solutions
SkiDK
Solution Sage
Solution Sage

You could in the DataSource property of the form fill in a big Switch case on which you choose which datasource to use depending on a variable. If you click on on an item in the gallery, it updates the variable that stands for the datascource that should be displayed.

 

UpdateContext({vDataSource: 0});

gal.OnSelect: UpdateContext({vDataSource: ThisItem.Id}); //or any other property

frm.DataSource:
Switch( 
  vDataSource,
    1,
    DataSource_1,
    2,
    DataSource_2,
    N,
    DataSource_N
)

 

 

View solution in original post

1 REPLY 1
SkiDK
Solution Sage
Solution Sage

You could in the DataSource property of the form fill in a big Switch case on which you choose which datasource to use depending on a variable. If you click on on an item in the gallery, it updates the variable that stands for the datascource that should be displayed.

 

UpdateContext({vDataSource: 0});

gal.OnSelect: UpdateContext({vDataSource: ThisItem.Id}); //or any other property

frm.DataSource:
Switch( 
  vDataSource,
    1,
    DataSource_1,
    2,
    DataSource_2,
    N,
    DataSource_N
)

 

 

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 (1,310)