Skip to main content

Notifications

Power Apps - Building Power Apps
Answered

Error while Patching two SharePoint list in If condition

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

  • r_voyager Profile Picture
    r_voyager 130 on at
    Re: Error while Patching two SharePoint list in If condition

    Thanks @EdViegas .

  • Verified answer
    EdViegas Profile Picture
    EdViegas 436 on at
    Re: Error while Patching two SharePoint list in If condition

    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}
     )
    );

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

November 2024 Newsletter…

November 2024 Community Newsletter…

Community Update Oct 28…

Power Platform Community Update…

Tuesday Tip #7 Community Profile Tips…

Welcome to a brand new series, Tuesday Tips…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 143,487

#2
RandyHayes Profile Picture

RandyHayes 76,308

#3
Pstork1 Profile Picture

Pstork1 64,014

Leaderboard