Reply
Level: Powered On
Posts: 9
Registered: ‎04-12-2017
Accepted Solution

auto generate app with multiple SharePoint lists

Hi,

I would like to create an app similar to the ones that are auto generated by PowerApps, but based on several Sharepoint lists :

I would need to create a first Screen allowing to choose which Sharepoint list to acces and the next screens would be identical to the ones generated by PowerApps. How can I integrate several auto generated apps into one?


Accepted Solutions
Level 10
Posts: 595
Registered: ‎04-29-2016

Re: auto generate app with multiple SharePoint lists

@v-micsh-msft is right--you will need to connect your datasources to a control. 

 

Below is a method in which I use a Dropdown menu to determine which list is needed, a Button that triggers the Navigation, then screens duplicated for each form.

 

First autogenerate an app from any SharePoint List. We are going to use these for duplicating later.

 

Next, create a new screen where you will have the user navigate to their desired list.

Use Table() in the Items property of a Dropdown menu:dropdown navigate.png

Table(
	{id: 1, screen: Screen2, name: "List 1"},
	{id: 2, screen: Screen3, name: "List 2"}
)

Each row of the formula lists the name of the SharePoint list and the Screen I want it associated with. The advantage of the Table function is that it can reference Screens where few other functions can. I also gave each list an id number which I can reference in conditional statements later. 

 

Next setup a Button that determines where to go:

 

 

dropdown navigate button.png

 

 

Navigate(Dropdown1.Selected.screen,Fade)

 

The formula means, "Navigate to the screen that is listed for the record that has been selected in the Dropdown menu."

 

The next step is messy. There's a few methods you can go with depending on what is easier for you or if you want to be more efficient.

  • Method 1: copy the screens for BrowseScreen, DisplayScreen, and EditScreen for each SharePoint list. Reconfigure each gallery and form to match the correct list. Revise the Table() function in your Dropdown menu as necessary. I think this one is easier to understand, but you will end up a number of screens equal to 3 x [number of SharePoint lists].
  • Method 2: keep your app to only 4 screens: BrowseScreen, DisplayScreen, EditScreen, and the one with the Dropdown (SetupScreen). Instead of duplicating screens, duplicate the gallery on each screen instead. Program the Items of each gallery to the SharePoint list of your choice, then make it Visible only when the id number selected in the Dropdown (Dropdown.Selected.id) matches the number you associated with it. This method should be more efficient.
http://www.8bitclassroom.com
@8bitclassroom

View solution in original post


All Replies
Community Support Team
Posts: 2,855
Registered: ‎09-20-2016

Re: auto generate app with multiple SharePoint lists

Hi @shugs,

 

 

At the begining I thought we could take use of collection to "store" Data source (should be connections), then use the dropdown to choose the proper one, but it seems that collection won't be created if data source is configured as an item in a record.

 

Another way is the following:

Say, we have special TextInput under the first screen,which is used to filter which data source that we should work with.

Then Add a Button, with its OnSelect property configured with the If function, and the corresponding Naviagte formula to the proper Gallery screen.

This would require all the data sources connected with the proper Navigate Screen, and the corresponding Details and editing screen bound to it.

 

@mr-dang@Meneghino@hpkeong, do you have any better ideas on this?

 

Regards,

Michael

 

Level 10
Posts: 595
Registered: ‎04-29-2016

Re: auto generate app with multiple SharePoint lists

@v-micsh-msft is right--you will need to connect your datasources to a control. 

 

Below is a method in which I use a Dropdown menu to determine which list is needed, a Button that triggers the Navigation, then screens duplicated for each form.

 

First autogenerate an app from any SharePoint List. We are going to use these for duplicating later.

 

Next, create a new screen where you will have the user navigate to their desired list.

Use Table() in the Items property of a Dropdown menu:dropdown navigate.png

Table(
	{id: 1, screen: Screen2, name: "List 1"},
	{id: 2, screen: Screen3, name: "List 2"}
)

Each row of the formula lists the name of the SharePoint list and the Screen I want it associated with. The advantage of the Table function is that it can reference Screens where few other functions can. I also gave each list an id number which I can reference in conditional statements later. 

 

Next setup a Button that determines where to go:

 

 

dropdown navigate button.png

 

 

Navigate(Dropdown1.Selected.screen,Fade)

 

The formula means, "Navigate to the screen that is listed for the record that has been selected in the Dropdown menu."

 

The next step is messy. There's a few methods you can go with depending on what is easier for you or if you want to be more efficient.

  • Method 1: copy the screens for BrowseScreen, DisplayScreen, and EditScreen for each SharePoint list. Reconfigure each gallery and form to match the correct list. Revise the Table() function in your Dropdown menu as necessary. I think this one is easier to understand, but you will end up a number of screens equal to 3 x [number of SharePoint lists].
  • Method 2: keep your app to only 4 screens: BrowseScreen, DisplayScreen, EditScreen, and the one with the Dropdown (SetupScreen). Instead of duplicating screens, duplicate the gallery on each screen instead. Program the Items of each gallery to the SharePoint list of your choice, then make it Visible only when the id number selected in the Dropdown (Dropdown.Selected.id) matches the number you associated with it. This method should be more efficient.
http://www.8bitclassroom.com
@8bitclassroom
Highlighted
Level 10
Posts: 788
Registered: ‎04-26-2016

Re: auto generate app with multiple SharePoint lists

hi @v-micsh-msft @mr-dang

 

In fact, you and brian has given a very clear explanation with bundle of examples and that should provide an in-depth understanding.

Appreciate.

 

Hong

hpkeong