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 / Operator Column in Sha...
Power Apps
Answered

Operator Column in SharePoint List

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hi all,

 

I have operator column in SharePoint list which contains(<, >, != etc.). I want to compare my value using an operator from SharePoint list.

Like for example:

Amount    Operator

10                 <

20                 >

 

//DataCardValue16.Text = 15

//Amount = 10

Filter(SP_List, DataCardValue16.Text  > Amount )    // here I want to use dynamic operator

 

Is possible to use this scenario as i want to dynamically select the operator against value in SharePoint list?

 

Regards,

Ahmad.

Categories:
I have the same question (0)
  • WarrenBelz Profile Picture
    156,384 Most Valuable Professional on at

    HI @Anonymous ,

    The Short answer is no - you cannot refer to anything (controls, fields, operators) dynamically in Power Apps. You could do it with If() statements using each value and then the statement that applies to it.

     

    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.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Thanks WarrenBelz.

     

    Solved my problem but I am facing a delegation issue in filter and I don't know how to get rid of this

    here you can the code:

    ==========

    Filter(
    SP_List,
    If(
    operatorLabel.Text = ">" ,DataCardValue16.Text > Amount,
    operatorLabel.Text = "<" ,DataCardValue16.Text < Amount,
    operatorLabel.Text = "!=" ,DataCardValue16.Text <> Amount,
    operatorLabel.Text = ">=" ,DataCardValue16.Text >= Amount,
    operatorLabel.Text = "<=" ,DataCardValue16.Text <= Amount

    )

    =======
    Regards

    Ahmad.

  • WarrenBelz Profile Picture
    156,384 Most Valuable Professional on at

    Hi @Anonymous ,

    One reason for the Delegation warning is the <> (does not equal) operator. Also I assume that the Amount is a numeric value, so try try this

    With(
     {wValue:Value(DataCardValue16.Text)},
     Filter(
     SP_List,
     Switch(
     operatorLabel.Text,
     ">", wValue > Amount,
     "<", wValue < Amount,
     "!=", Abs(wValue-Amount)>0,
     ">=", wValue >= Amount,
     "<=", wValue <= Amount
     )
     )
    )

     

    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.

  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @WarrenBelz  actually <> is delegable for numeric, but I had to chime in because I LOVE the use of Abs for the not equal operation!!!  

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Thanks again.

    I am still getting a delegation problem in this code. Is it because i am using switch in filter ?

  • Verified answer
    WarrenBelz Profile Picture
    156,384 Most Valuable Professional on at

    @Anonymous ,

    No - Switch is nothing more than a "shorthand" If() statement. It seems two things - the conditional filter does not like Delegation and also not the Abs() - though I have used it before. The below is Delegable

    With(
     {wValue: Value(DataCardValue16.Text)},
     Switch(
     operatorLabel.Text,
     ">",
     Filter(
     SP_List,
     wValue > Amount
     ),
     "<",
     Filter(
     SP_List,
     wValue < Amount
     ),
     "!=",
     Filter(
     SP_List,
     wValue <> Amount
     ),
     ">=",
     Filter(
     SP_List,
     wValue >= Amount
     ),
     "<=",
     Filter(
     SP_List,
     wValue <= Amount
     )
     )
    )

     

    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.

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 401 Most Valuable Professional

#2
11manish Profile Picture

11manish 201 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 128 Super User 2026 Season 2

Last 30 days Overall leaderboard