web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Problem with filtering...
Power Apps
Unanswered

Problem with filtering by multiple condtions

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hi, I want to set a value in combobox based on text in DataCardValue19. Then I write a formula to DefaultSelectedItems on my combobox DataCardValue5:

 

Filter(Choices(Shortages.CFT),Text(Value)=If(StartsWith(DataCardValue19.Text,"V")||DataCardValue19.Text="NPA"||DataCardValue19.Text="NFA","Vestas"))

 

this is works, but when I want to add additional conditions I get error: "This predicate is a literal value and does not reference the input table" e.g. for this formula:

 

Filter(Choices(Shortages.CFT),Text(Value)=If(StartsWith(DataCardValue19.Text,"V")||DataCardValue19.Text="NPA"||DataCardValue19.Text="NFA","Vestas"),If(StartsWith(DataCardValue19.Text,"H"),"Magna"))

 

Combobox has got choice datatype in dataverse.

 

previously i tried to set DefaultSelectedItems with condition but then the value from DataCardValue5 was not writing to dataverse, here link to topic: https://powerusers.microsoft.com/t5/Building-Power-Apps/Problem-with-save-data-from-combobox/td-p/1420759 

 

Please for help @timl @RandyHayes @WarrenBelz @AJ_Z @Pstork1 @BCLS776 

Categories:
I have the same question (0)
  • CU-18081211-6 Profile Picture
    9,270 Moderator on at

    @Anonymous ,

    Most probably is a syntax problem. Try this:

    Filter(
    Choices(Shortages.CFT),
    Text(Value)=If(
     StartsWith(DataCardValue19.Text,"V")||DataCardValue19.Text="NPA"||DataCardValue19.Text="NFA",
     "Vestas",
     If(
     StartsWith(DataCardValue19.Text,"H"),
     "Magna")
     )
    )

     Hope it helps !

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    works, thank you 😄

    and i have one more question, when i have this condition:

    IsMatch(
     DataCardValue19.Text,
     "Sub",
     Contains
     ) || IsMatch(
     DataCardValue19.Text,
     "sub",
     Contains
     ) || IsMatch(
     DataCardValue19.Text,
     "SUB",
     Contains
     ),
     "Sub"

    i can simplify it with tolower or toupper function?

  • CU-18081211-6 Profile Picture
    9,270 Moderator on at

    @Anonymous ,

    I tended to say, why don't you try:

    "sub" in DataCardValue19.Text

    but I'm not quite sure if you want to include also variations like "sUb", "suB" or "sUB".

    The in operator is case-insensitive and will identify an appearance of "sub" combination (no matter if are upper/lower letter).

    Please mark my previous reply as solution if it helps you to solve the problem.

    Thanks.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    yes, I want to include such combinations as well

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    'in' works great for me, but i have the last problem i belive in this formula:

    Filter(
     Choices(Shortages.CFT),
     Text(Value) = If(
     StartsWith(
     DataCardValue19.Text,
     "V"
     ) || DataCardValue19.Text = "NPA" || DataCardValue19.Text = "NFA",
     "Vestas",
     
     If(StartsWith(DataCardValue19.Text,"IM") || DataCardValue19.Text = "Mzero",
     "Magna",
     If( "sub" in DataCardValue19.Text,
     "Sub",
     If(DataCardValue19.Text <> Blank(),
     "Siemens"
    )))))

    when I add the first record to the Siemens list it does not show up when DataCardValue19 is blank. but if it adds another record then Siemens appears immediately even though there is nothing in DataCardValue19. Do I have to clear DataCardValue19 every time I add a record?

     

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 893

#2
Valantis Profile Picture

Valantis 571

#3
11manish Profile Picture

11manish 482

Last 30 days Overall leaderboard