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 / Error while Patching t...
Power Apps
Answered

Error while Patching two SharePoint list in If condition

(0) ShareShare
ReportReport
Posted on by 130

I'm patching two SharePoint lists in else part of if condition but it returns an error : "Expecting one of the following Boolean ,Number ,Text,OptionSet Value."

My code is :
If(
isBlank(textinput.text),Notify("Field is required",Error),Patch(
SharePointList1,defaults(SharePointList1),{Name:textinput.text}
) && Patch(
SharePointList2,defaults(SharePointList2),{Name:textinput.text}
)
);

After first Patch function it does not even allow any Reset(),Navigate() or any other function.

I want to use validation for once only, otherwise to Patch second list I had to write these conditions again. 

Can anybody tell me what mistake I'm making?

Regards,
Rahul

Categories:
  • Verified answer
    EdViegas Profile Picture
    436 on at

    Assuming that column "Name" is a text column, try

    If(
     IsBlank(textinput.text),
     Notify("Field is required", NotificationType.Error),
     Patch(
     SharePointList1,
     Defaults(SharePointList1),
     {Name:textinput.text}
     );
     Patch(
     SharePointList2,
     Defaults(SharePointList2),
     {Name:textinput.text}
     )
    );
  • r_voyager Profile Picture
    130 on at

    Thanks @EdViegas .

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

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 232 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 202 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 122

Last 30 days Overall leaderboard