cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Oos
Level: Powered On

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
Level 8

Re: 1 form for multiple datasources.

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
Level 8

Re: 1 form for multiple datasources.

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
thirdimage

Power Apps Super User Class of 2020

Check it out!

thirdimage

New Badges

Check it out!

thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

SecondImage

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Solution Authors
Top Kudoed Authors
Users online (5,314)