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 / IF condition not working
Power Apps
Answered

IF condition not working

(0) ShareShare
ReportReport
Posted on by

any correction required in below code, it showing error as invalid arugument type ,expecting boolean.

 

 

If(LookUp(
'backup',
Title =TextInput2.Text),

Patch(
'backup',
LookUp(
'backup',
Title = TextInput2.Text),
{Title: TextInput2.Text},
{Source: TextInput3.Text}

),
Patch(
'backup',
Defaults('backup'),
{Title: TextInput2.Text},
{Source: TextInput3.Text}
)

)

Categories:
I have the same question (0)
  • Verified answer
    WarrenBelz Profile Picture
    154,426 Most Valuable Professional on at

    Hi @venky232 ,

    That is because you need to test the top statement with IsBlank, but try this

    With(
     {
     wID:
     LookUp(
     'backup',
     Title = TextInput2.Text
     ).ID
     },
     Patch(
     'backup',
     If(
     IsBlank(wID),
     Defaults('backup'),
     {ID: wID}
     ),
     {
     Title: TextInput2.Text,
     Source: TextInput3.Text
     }
     )
    )

     

    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.

    Visit my blog Practical Power Apps

     

  • poweractivate Profile Picture
    11,078 Most Valuable Professional on at
    //untested - adjust as needed
    
    With
    (
     {
     _myRecord
     ,LookUp
     (
     'backup'
     ,Title =TextInput2.Text
     )
     }
     ,If
     (
     !IsBlank
     (
     _myRecord
     ,Patch
     (
     'backup'
     ,{
     ID:_myRecord.ID
     ,Title:TextInput2.Text
     ,Source:TextInput3.Text
     }
     )
     ,Patch
     (
     'backup'
     ,{
     Title:TextInput2.Text
     ,Source:TextInput3.Text
     }
     )
     )
     )
     
    )
  • poweractivate Profile Picture
    11,078 Most Valuable Professional on at

    @venky232 Possibly better version:

     

     

    //untested - adjust as needed
    
    With
    (
     {
     _myRecord
     ,LookUp
     (
     'backup'
     ,Title =TextInput2.Text
     )
     }
     ,Patch
     (
     'backup'
     ,{
     ID:If(!IsBlank(_myRecord,_myRecord.ID,Blank())
     ,Title:TextInput2.Text
     ,Source:TextInput3.Text
     }
     )
     
     
     
    )

     

     


    If any problem with the above, try this below:

    Check if turning on the formula-level error management setting helps with any issue:

     

    1. Click Settings

    2. Click Upcoming Features

    3. Toggle the Formula-level error management setting to On

    Then just close the modal, see if it works.

     

    poweractivate_0-1664838760107.png

     

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!

Leaderboard > Power Apps

#1
wolenberg_ Profile Picture

wolenberg_ 119 Super User 2026 Season 1

#2
WarrenBelz Profile Picture

WarrenBelz 107 Most Valuable Professional

#3
Haque Profile Picture

Haque 103

Last 30 days Overall leaderboard