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 / Statement assistance w...
Power Apps
Answered

Statement assistance with 2 conditions 1 required

(0) ShareShare
ReportReport
Posted on by 1,168

Hi,

 

Trying to get my head around the format of a statement that has 2 conditions, the first required and the second only if true

 

for example

 

if ColA true and TextInput1.Text = ColB or TextInput1.Text = ColC or TextInput1.Text = ColD TextInput1.Text = ColE)

 

Thanks in advance for any assistance

 

Todd

Categories:
I have the same question (0)
  • Ami K Profile Picture
    15,687 Super User 2024 Season 1 on at

    @Tango - what is the data type for ColB, ColC and ColD?

     

    Is it Text?

  • Tango Profile Picture
    1,168 on at

    @Amik Yes

  • Ami K Profile Picture
    15,687 Super User 2024 Season 1 on at

    Assuming these arguments should apply to a Gallery or EditForm, this is the formula based on what you have described:

    If(
    
     Or(
    
     ThisItem.ColA = "true" && ThisItem.ColB= TextInput1.Text, 
     //if ColA true and TextInput1.Text = ColB 
    
     ThisItem.ColC = TextInput1.Text, 
     //or TextInput1.Text = ColC 
    
     ThisItem.ColC = TextInput1.Text 
     //or TextInput1.Text = ColC
     ),
    
     ThisItem.ColD = TextInput1.Text, 
     //TextInput1.Text = ColD)
     Blank()
    
    )

     

  • Tango Profile Picture
    1,168 on at

    @Amik Thanks for your reply.

     

    ColA has to equal true on all.

  • Verified answer
    Ami K Profile Picture
    15,687 Super User 2024 Season 1 on at

    Apply another “&&” operator to the other conditions to check ColA.

     

    Also, your description is not terribly clear / does not make sense. It’s not clear why Col C is appearing twice in your description, and whether ColD is also a condition to check. It is also not clear what is supposed to happen if the If statement returns true or false.

     

    Assuming you just want to return a Boolean true/false. Use either:

     

     

    Or(
     ThisItem.ColA = "True" && ThisItem.ColB = TextInput1.Text,
     ThisItem.ColA = "True" && ThisItem.ColC = TextInput1.Text,
     ThisItem.ColA = "True" && ThisItem.ColD = TextInput1.Text)

     

     

     

    And(ThisItem.ColA = "True",
     Or(
     ThisItem.ColB = TextInput1.Text,
     ThisItem.ColC = TextInput1.Text,
     ThisItem.ColD = TextInput1.Text 
     )
    )

     

     

     

    ------------------------------------------------------------------------------------------------------------------------------

    If I have answered your question, please mark your post as Solved.

    If you like my response, please give it a Thumbs Up.

  • Tango Profile Picture
    1,168 on at

    Thanks @Amik, just rectified that. It actually will return results from a gallery

  • Ami K Profile Picture
    15,687 Super User 2024 Season 1 on at

    Need anything else or has my previous response answered the question?

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 March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 541

#2
WarrenBelz Profile Picture

WarrenBelz 434 Most Valuable Professional

#3
Valantis Profile Picture

Valantis 289

Last 30 days Overall leaderboard