Skip to main content

Notifications

Power Pages - Design & Build
Unanswered

Delegatio on functions with switch

(0) ShareShare
ReportReport
Posted on by 4
Hi I am creating an app that is used across multiple countries. The app uses Sharepoint as data source but the set of lists changes with the user region. Up to this moment I used something a bite brute-forcish like this (just as an example):
 
Count(Filter(Switch(varRegion, "Region1", List1, "Region2", List2, "Region3", List3, "Region4", List4), field1 =  var1 &&  field2 = var2).ID)
 
What I noticed is that the Switch function with such an approach breaks down delegation on SP, so it works fine with lists with just over 1000 lines, and breaks down on list with over 4k lines. The functions work fine if I split them to not use Switch or If after Filter - however with that the code grows quite significantly with no apparent need. Any way to do it better? Can I somehow store datasource as variable within the tool (it's not environmental so env variable will not work I think)
 
 
Categories:
  • JL-14111105-0 Profile Picture
    JL-14111105-0 4 on at
    Delegatio on functions with switch
    Storing list in var has smilar issues - it breaks delegatio and in only able to pick up data from 1st 2000 rows
  • SaiRT14 Profile Picture
    SaiRT14 1,755 on at
    Delegatio on functions with switch
    Try the following:
    Store List in a Variable:: Set(varDataSource, Switch(varRegion, "Region1", List1, "Region2", List2, ...))
    Count(Filter(varDataSource, field1 = var1 && field2 = var2).ID)
     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

End of Year Newsletter…

End of Year Community Newsletter…

Tuesday Tip #12 Start your Super User…

Welcome to a brand new series, Tuesday Tips…

Tuesday Tip #11 New Opportunities…

Welcome to a brand new series, Tuesday Tips…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 144,609

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,420

Leaderboard

Featured topics