cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
GTSam
Frequent Visitor

Dynamic Data Sources

Hi All,

 

I have several SharePoint Lists added to my PowerApp. On one screen I have a Gallery where I want to be able to dynamically display the data of various different events lists.

All of the SharePoint Lists are identical in column Layout. 

What is wrong with the code that I have included below that it throws up an error as having invalid arguments?

 

Sort(
    Filter(
        (Switch(
    ComboBox1.Selected.City,
    "Cannington",'WA Metro Events',
    "Artarmon",'NSW Metro Events',
    "Heatherton",'VIC Metro Events',
    "West End",'QLD Metro Events',
    "Newcastle",'NSW North Metro Events',
    "Clarence Gardens", 'SA Metro Events',
    "Hobart", 'TAS Events',
    "Fyshwick", 'ACT Events',
    "Berrimah", 'NT Events'
    )),
        'Start Time' >= Today()
    ),
    'Start Time',
    Ascending
)

 

 

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @GTSam ,

 I must admit I have never tried to do what you are doing - have you considered simply having one list and a field for city ? There are times where you simply need to plan your data to suit the app, not the other way around.

 

View solution in original post

3 REPLIES 3
WarrenBelz
Super User
Super User

Hi @GTSam ,

Apart from a couple of unnecessary brackets, the structure is correct, however for this to have any chance of being valid, all the lists would need to be identical in field names and field types - is this the case ?

Sort(
    Filter(  
      Switch(
         ComboBox1.Selected.City,
         "Cannington",
         'WA Metro Events',
         "Artarmon",
         'NSW Metro Events',
         "Heatherton",
         'VIC Metro Events',
         "West End",
         'QLD Metro Events',
         "Newcastle",
         'NSW North Metro Events',
         "Clarence Gardens", 
         'SA Metro Events',
         "Hobart", 
         'TAS Events',
         "Fyshwick", 
         'ACT Events',
         "Berrimah", 
         'NT Events'
      ),
      'Start Time' >= Today()
    ),
    'Start Time',
    Ascending
)

BTW - good to see at least 1 Qld event in there . . . 

 

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.

Visit my blog Practical Power Apps

Yes all of the lists are exact copies of each other except for the data of course. Same field names and types.

 

Despite that this should work, it still throws up the invalid arguments error. 

Hi @GTSam ,

 I must admit I have never tried to do what you are doing - have you considered simply having one list and a field for city ? There are times where you simply need to plan your data to suit the app, not the other way around.

 

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (3,484)