cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper III
Helper III

Select with Dropdown Datasource for Gallery

Hi,

 

I tried to create a easy App (so I thought) but now I tried so mach ways and have no idea how it works.

 

I wanna create a App which have as a DataSource a Excelfile. In this are different tables (a.E.: "2019", "2018", "2017",...)

The strcuture of the tables are the same. Their are Names and 30 Dates (1., 2., 3., ..., 30.). In this are the holidays of the Employees stored.

 1.2.3.4....
Name_131.03.1901.04.1902.04.1903.04.19...
Name_201.05.1902.05.1903.05.1904.05.19 
Name_305.02.1906.02.1907.02.1908.02.19 
Name_401.01.1902.01.1903.01.1904.01.19 

 

The App looks like that and have to show which holidays in the year are taken with the date.

 

Bildschirmfoto 2019-08-04 um 20.10.23.png

 

With the Dropdown the App loads the Datasource in the Gallery. I realized this with a If-Formula in the Gallery items:

 

SortByColumns(Search(If(var_JahrTxt="2018";UrlList_2018;UrlList_2019); TextSearchBox1.Text; "Spalte1"); "Spalte1"; If(SortDescending1; Descending; Ascending))

This works. But in the DetailForm1 the formula 

If(var_JahrTxt="2018";UrlList_2018;UrlList_2019)

gives a error.

 

What can I do or is there a easier way to realize this app?

2 ACCEPTED SOLUTIONS

Accepted Solutions
Highlighted
Super User III
Super User III

Re: Select with Dropdown Datasource for Gallery

Hi @dobroo 

You are getting there.  You are in the process of what is called normalizing your data and the goal is to not have any repeating data in a table. The next step would be to have a table of Names that you can add additional information regarding each one.  Have an ID column for each name (That is called the Primary key) and then substitute it into your table (it would be called the Foreign key in the table, call it NameID).  You could then use a Lookup() in your gallery to bring in the name and any other identifying information regarding that person from the Name table. 

View solution in original post

Highlighted
Community Support
Community Support

Re: Select with Dropdown Datasource for Gallery

Hi @dobroo ,

Have you solved your problem?

 

Currently, within PowerApps, the DataSource property of the Display form is only supported to connect to a specific data source. The formua does not work within the DataSource property of the Display form.

 

As an alternative solution, you could consider create one Display form for each year (e.g. 2017, 2018, 2019, ...) in your Detail screen. Then within your Detail screen, DisplayForm1 connects to UrlList_2018, DisplayForm2 connects to UrlList_2019, ...

After that, set the Visible property of the Display form in your Detail screen to following:

DisplayForm1.Visible:

 

If(
   var_JahrTxt = "2018",
true,
false )

DisplayForm2.Visible:

If(
   var_JahrTxt = "2019",
   true,
   false
)

...

 

 

Please take a try with above solution, check if the issue is solved.

 

Best regards,

 

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

8 REPLIES 8
Highlighted
Super User III
Super User III

Re: Select with Dropdown Datasource for Gallery

Hi @dobroo 

I think you have made your app more complicated than it needs to be by having multiple tables.  It should be possible to combine your tables into one with a column for year.  That way you could filter the table on year. The problem is that you can only have a display (or edit) form with a single datasource.  Otherwise you will need to have one for each table. 

Highlighted
Helper III
Helper III

Re: Select with Dropdown Datasource for Gallery

@Drrickryp 

 

That was my first try. 

But therefore I had to build the sheet like this:

YearDaysName_1Name_2Name_3Name_4...
20181.01.04.1802.04.1803.04.1803.03.18...
20182.02.05.1803.05.1804.05.1804.03.18...
.....................
20191.02.01.1903.01.1904.07.1901.05.19...
20192.03.01.1904.01.1905.07.1902.05.19...

 

But in this case I have no idea to switch the data for the gallery.

 

The data will be read for the row and not for the columns.

 

As example:

 1.2.3.4....
Name_131.03.1901.04.1902.04.1903.04.19...
Name_201.05.1902.05.1903.05.1904.05.19 
Name_305.02.1906.02.1907.02.1908.02.19 
Name_401.01.1902.01.1903.01.1904.01.19 

 

Here are the titles

 

Name_1

Name_2

Name_3

Name_4

 

and I get in the DetailForm all the datas of the name.

 

In this case

YearDaysName_1Name_2Name_3Name_4...
20181.01.04.1802.04.1803.04.1803.03.18...
20182.02.05.1803.05.1804.05.1804.03.18...
.....................
20191.02.01.1903.01.1904.07.1901.05.19...
20192.03.01.1904.01.1905.07.1902.05.19...

 

The titles are

 

2018

2018

...

2019

2019 

 

and the datas in the Detailform are read from left to right and not for a column.

 

Can I switch the affiliation? Not left to right but up to down.

 

You understand my thoughts?

Highlighted
Super User III
Super User III

Re: Select with Dropdown Datasource for Gallery

Hi @dobroo 

I'm not sure I understand what you have done with your tables.  I have written a multi-part discussion of database design in the community blog.  Could you please read through it for tips on how to property design your app.  It starts with the overview. https://powerusers.microsoft.com/t5/PowerApps-Community-Blog/Database-Design-Fundamentals-and-PowerA...

Highlighted
Helper III
Helper III

Re: Select with Dropdown Datasource for Gallery

Hi @Drrickryp ,

 

I have found a solution. Looks (for me) not so pretty, but it works.

 

YearName1.2.3.4.
2018Name 0107.03.201822.06.201808.11.201803.07.2018
2018Name 0205.02.201819.07.201803.05.201823.08.2018
2018Name 0309.05.201819.09.201822.12.201810.12.2018
2018Name 0404.03.201825.04.201803.02.201802.05.2018
2018Name 0530.05.201805.02.201807.03.201802.06.2018
2018Name 0612.04.201809.05.201810.12.201828.02.2018
2018Name 0723.06.201807.07.201818.10.201818.04.2018
2018Name 0808.10.201818.09.201828.01.201824.10.2018
2018Name 0925.05.201820.06.201810.01.201826.05.2018
2018Name 1012.06.201811.05.201811.07.201813.06.2018
2019Name 0125.07.201917.06.201918.02.201902.02.2019
2019Name 0224.06.201903.10.201917.01.201923.01.2019
2019Name 0328.07.201915.09.201926.05.201917.08.2019
2019Name 0404.02.201902.05.201916.01.201918.04.2019
2019Name 0518.08.201904.10.201915.12.201925.04.2019
2019Name 0605.07.201908.05.201914.09.201916.08.2019
2019Name 0719.11.201926.11.201928.02.201917.06.2019
2019Name 0825.07.201917.06.201917.09.201926.01.2019
2019Name 0905.04.201927.09.201924.06.201918.04.2019
2019Name 1026.05.201925.02.201926.03.201921.08.2019

 

In this case I have always to repeat the names for the years.

My thought was to create a 3D table.

Highlighted
Super User III
Super User III

Re: Select with Dropdown Datasource for Gallery

Hi @dobroo 

You are getting there.  You are in the process of what is called normalizing your data and the goal is to not have any repeating data in a table. The next step would be to have a table of Names that you can add additional information regarding each one.  Have an ID column for each name (That is called the Primary key) and then substitute it into your table (it would be called the Foreign key in the table, call it NameID).  You could then use a Lookup() in your gallery to bring in the name and any other identifying information regarding that person from the Name table. 

View solution in original post

Highlighted
Helper III
Helper III

Re: Select with Dropdown Datasource for Gallery

Ok. I hope I understand everything.

 

In my case I had another table like

 

NameIDName
XYZ1000Name 01
XYZ1001Name 02

 

And my first Table gets another column with the NameID. 

 

If I filter the Data with Year: "2018" and the NameID: "XYZ1000" I get the this data:

07.03.201822.06.201808.11.201803.07.2018

 

correct?

Highlighted
Community Support
Community Support

Re: Select with Dropdown Datasource for Gallery

Hi @dobroo ,

Have you solved your problem?

 

Currently, within PowerApps, the DataSource property of the Display form is only supported to connect to a specific data source. The formua does not work within the DataSource property of the Display form.

 

As an alternative solution, you could consider create one Display form for each year (e.g. 2017, 2018, 2019, ...) in your Detail screen. Then within your Detail screen, DisplayForm1 connects to UrlList_2018, DisplayForm2 connects to UrlList_2019, ...

After that, set the Visible property of the Display form in your Detail screen to following:

DisplayForm1.Visible:

 

If(
   var_JahrTxt = "2018",
true,
false )

DisplayForm2.Visible:

If(
   var_JahrTxt = "2019",
   true,
   false
)

...

 

 

Please take a try with above solution, check if the issue is solved.

 

Best regards,

 

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Highlighted
Helper III
Helper III

Re: Select with Dropdown Datasource for Gallery

@v-xida-msft 

 

Sorry for the late Reply

 

Your suggestion was my first impulse.

 

I tested this and my solution was to reorganize the data.

 

After the transport to the new data structure I am able to automate the years.

 

Therefore is the issue solved. Smiley Wink

 

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Watch Now

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (6,578)