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

Latest Update Creating Error in Gallery that uses multiple data sources

I was not sure where to post this. The latest update 3.18054.15 will not process my gallery items properly. I have three databases from sharepoint with identical layout. I have more than 5,000 records so they are in 3. I use a series of dropdown menus to tell the gallery which datasource to use and which records to pull. This works fine in the previous releases, but now I am getting an error message saying that the gallery can only access one data source. Please fix this.

3 REPLIES 3
v-monli-msft
Community Support
Community Support

Hi @cyoung5555,

 

Please share more detailed configuration of your app. Like the related formulas and how many galleries do you have and how each one is configured.

 

Regards,

Mona

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

The error message I get is that all possible results of the If function must reference the same data source.

There are three sharepoint lists that I have added NALOFData1, NALOSData1, CALAData1

 

I have a bunch of dropdowns and combo boxes that drive the gallery formula.

 

Here is the gallery formula.

 

If(And(DB_Data.Selected.Value="NALO FS", DB_Search.Selected.Value="Owner"), SortByColumns(Filter(NALOFData1,StartsWith(Owner,TxtHotelDB.Text)),"BrandLocator1", If(SortDescending1, SortOrder.Descending, SortOrder.Ascending)),
If(And(DB_Data.Selected.Value="NALO FS", DB_Search.Selected.Value="MgmtCo"), SortByColumns(Filter(NALOFData1,StartsWith(MgmtCo,TxtHotelDB.Text)),"BrandLocator1", If(SortDescending1, SortOrder.Descending, SortOrder.Ascending)),
If(And(DB_Data.Selected.Value="NALO FS", DB_Search.Selected.Value="Brand Location"), SortByColumns(Filter(NALOFData1,StartsWith(BrandLocator1,TxtmyBrandLocation.Text)), "BrandLocator1", If(SortDescending1, SortOrder.Descending, SortOrder.Ascending)),
If(And(DB_Data.Selected.Value="NALO FS", DB_Search.Selected.Value="Country"), SortByColumns(Filter(NALOFData1,StartsWith(Country,DB_Country.Selected.Value)), "StateRev", If(SortDescending1, SortOrder.Descending, SortOrder.Ascending)),
If(And(DB_Data.Selected.Value="NALO FS", DB_Search.Selected.Value="State City"), SortByColumns(Filter(NALOFData1,StartsWith(StateCity,TxtmyStateCity.Text)), "BrandLocator1", If(SortDescending1, SortOrder.Descending, SortOrder.Ascending)),
If(And(DB_Data.Selected.Value="NALO MSB",DB_Search.Selected.Value="Owner"), SortByColumns(Filter(NALOSData1,StartsWith(Owner, TxtHotelDB.Text)), "BrandLocator1", If(SortDescending1, SortOrder.Descending, SortOrder.Ascending)),
If(And(DB_Data.Selected.Value="NALO MSB", DB_Search.Selected.Value="MgmtCo"), SortByColumns(Filter(NALOSData1,StartsWith(MgmtCo,TxtHotelDB.Text)),"BrandLocator1", If(SortDescending1, SortOrder.Descending, SortOrder.Ascending)),
If(And(DB_Data.Selected.Value="NALO MSB",DB_Search.Selected.Value="Brand Location"), SortByColumns(Filter(NALOSData1,StartsWith(BrandLocator1,TxtmyBrandLocation.Text)),"BrandLocator1", If(SortDescending1, SortOrder.Descending, SortOrder.Ascending)),
If(And(DB_Data.Selected.Value="NALO MSB", DB_Search.Selected.Value="Country"), SortByColumns(Filter(NALOSData1,StartsWith(Country,DB_Country.Selected.Value)), "StateRev", If(SortDescending1, SortOrder.Descending, SortOrder.Ascending)),
If(And(DB_Data.Selected.Value="NALO MSB", DB_Search.Selected.Value="State City"), SortByColumns(Filter(NALOSData1,StartsWith(StateCity,TxtmyStateCity.Text)), "BrandLocator1", If(SortDescending1, SortOrder.Descending, SortOrder.Ascending)),
If(And(DB_Data.Selected.Value="CALA", DB_Search.Selected.Value="Owner"), SortByColumns(Filter(CALAData1,StartsWith(Owner,TxtHotelDB.Text)),"BrandLocator1", If(SortDescending1, SortOrder.Descending, SortOrder.Ascending)),
If(And(DB_Data.Selected.Value="CALA", DB_Search.Selected.Value="MgmtCo"), SortByColumns(Filter(CALAData1,StartsWith(MgmtCo,TxtHotelDB.Text)),"BrandLocator1", If(SortDescending1, SortOrder.Descending, SortOrder.Ascending)),
If(And(DB_Data.Selected.Value="CALA", DB_Search.Selected.Value="Brand Location"), SortByColumns(Filter(CALAData1,StartsWith(BrandLocator1,TxtmyBrandLocation.Text)), "BrandLocator1", If(SortDescending1, SortOrder.Descending, SortOrder.Ascending)),
If(And(DB_Data.Selected.Value="CALA", DB_Search.Selected.Value="State City"), SortByColumns(Filter(CALAData1,StartsWith(StateCity,TxtmyStateCity.Text)), "BrandLocator1", If(SortDescending1, SortOrder.Descending, SortOrder.Ascending)),
If(And(DB_Data.Selected.Value="CALA", DB_Search.Selected.Value="Country"), SortByColumns(Filter(CALAData1,StartsWith(Country,DB_Country.Selected.Value)), "BrandLocator1", If(SortDescending1, SortOrder.Descending, SortOrder.Ascending)), SortByColumns(Filter(CALAData1,StartsWith(Country,DB_Country.Selected.Value)), "BrandLocator1", If(SortDescending1, SortOrder.Descending, SortOrder.Ascending)))))))))))))))))

 

This formula used to work fine.

The latest release has now fixed this issue. Thanks

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

Power Apps Community Call

Monthly Power Apps Community Call

Did you miss the call?? Check out the Power Apps Community Call here!

secondImage

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 the go-to Power Platform destination for ISV’s to monitor & manage applications post-AppSource publish.

Top Solution Authors
Top Kudoed Authors
Users online (11,921)