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 / Getting syntax error o...
Power Apps
Unanswered

Getting syntax error on Power apps code

(0) ShareShare
ReportReport
Posted on by 142

Hi there,

 

Here is a code and I am getting a small error  under first to Patch function; One after first patch function and other on closing If statement in second Patch function. Attached a pic below for understanding. can someone point out what could be causing it

Audi86_0-1692303094340.png

 

 

 

Also pasting code, just incase: 

 

If( 

 SharePointIntegration.Selected.'Created By'.Email = User().Email, 

 Notify("You can't like your own post!", NotificationType.Error), 

 

 IsBlank(LookUp(LikeResponses, UserID = User().Email && Title = Text(SharePointIntegration.Selected.ID))), 

 ( 

 Patch( 

 LikeResponses, 

 Defaults(LikeResponses), 

 { 

 UserID: User().Email, 

 Title: Text(SharePointIntegration.Selected.ID), 

 LikeStatus: 1 

 } 

 ); 

 If( 

 IsBlank(LookUp(LikesCount, Title = Text(SharePointIntegration.Selected.ID))), 

 Patch(LikesCount, Defaults(LikesCount), { Title: Text(SharePointIntegration.Selected.ID), TotalLikes: 1 }), 

 Patch( 

 LikesCount, 

 LookUp(LikesCount, Title = Text(SharePointIntegration.Selected.ID)), 

 { TotalLikes: Value(LookUp(LikesCount, Title = Text(SharePointIntegration.Selected.ID)).TotalLikes) + 1 } 

 ) 

 ) 

 ), 

 

 !IsBlank(LookUp(LikeResponses, UserID = User().Email && Title = Text(SharePointIntegration.Selected.ID), LikeStatus)) && LookUp(LikeResponses, UserID = User().Email && Title = Text(SharePointIntegration.Selected.ID)).LikeStatus = 1, 

 ( 

 Patch( 

 LikeResponses, 

 LookUp(LikeResponses, UserID = User().Email && Title = Text(SharePointIntegration.Selected.ID)), 

 { LikeStatus: 0 } 

 ); 

 Patch( 

 LikesCount, 

 LookUp(LikesCount, Title = Text(SharePointIntegration.Selected.ID)), 

 { TotalLikes: Value(LookUp(LikesCount, Title = Text(SharePointIntegration.Selected.ID)).TotalLikes) - 1 } 

 ) 

 ), 

 

 !IsBlank(LookUp(LikeResponses, UserID = User().Email && Title = Text(SharePointIntegration.Selected.ID), LikeStatus)) && LookUp(LikeResponses, UserID = User().Email && Title = Text(SharePointIntegration.Selected.ID)).LikeStatus = 0, 

 ( 

 Patch( 

 LikeResponses, 

 LookUp(LikeResponses, UserID = User().Email && Title = Text(SharePointIntegration.Selected.ID)), 

 { LikeStatus: 1 } 

 ); 

 Patch( 

 LikesCount, 

 LookUp(LikesCount, Title = Text(SharePointIntegration.Selected.ID)), 

 { TotalLikes: Value(LookUp(LikesCount, Title = Text(SharePointIntegration.Selected.ID)).TotalLikes) + 1 } 

 ) 

 ) 

) 

 

Categories:
I have the same question (0)
  • elseb Profile Picture
    774 Moderator on at

    Hi,

     

    I'm a little tired and could be wrong here but this parenthesis looks off to me, same for the other patch:

     IsBlank(LookUp(LikeResponses, UserID = User().Email && Title = Text(SharePointIntegration.Selected.ID))), 
    
     ( <----- this
    
     Patch( 

     

    Seb

     

  • Audi86 Profile Picture
    142 on at

    @elseb  Thanks for response, 

    Once i remove that Parenthesis, it showing this: 

    Audi86_0-1692309593148.png

    And this if I scroll down:

     

    Audi86_1-1692309645046.png

    And if i remove that one as well than I am seeing this :

     

    Audi86_2-1692309760652.png

     

  • elseb Profile Picture
    774 Moderator on at

    not going to lie I'm a little confused by that code, why the brackets in the first place? obviously now you're getting error because the closing bracket is still there, but I don't know if you need them at all, maybe it's something I haven't used before but I do if(thishappens, do this && also this, something else happens, do this &&  this instead, if neither of those are true do this)

    again i'm a little worn today so there is a chance i'm missing something.

     

    seb

  • Audi86 Profile Picture
    142 on at

    @elseb No Worries. I got this code from someone else for my power app customized form and like functionality  , will look more into it. Thanks for looking into it

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

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 325 Most Valuable Professional

#2
11manish Profile Picture

11manish 165

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 88 Super User 2026 Season 1

Last 30 days Overall leaderboard