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 / Patch lable value if c...
Power Apps
Answered

Patch lable value if contents of a variable matches contents of column on sharepoint

(0) ShareShare
ReportReport
Posted on by 95

Hello,

 

I am trying to Patch data to sharepoint (Personal Data) only if variable (Alias) value matches contents of the sharepoint. The update should be on the same row that the match occurs. I am getting errors and wondering what I am doing wrong

 

If(CountRows(Filter('Personal Data',Title = Alias))>0,Patch('Personal Data',{Result:Pers_Total}))

Categories:
I have the same question (0)
  • lmahmuti Profile Picture
    95 on at

    I inserted a label and assigned variable value to it (Pers_Total_1) and changed the code as follows but it is patching on the next line not on the line that the match is occurring 

     

    If(
    !IsEmpty(
    Filter(
    'Personal Data',
    Title = Pers_Total_1.Text
    )
    ),
    Patch(
    'Personal Data',
    {
    Title: Pers_Total_1.Text,
    Result: Pers_Total.Text
    }
    )

  • Verified answer
    Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    Hi @lmahmuti ,

    Your Patch() function is incorrect.  The Patch() function requires 3 elements, the datasource being patched, the record being patched and the items within that record.  You are missing the second element. In the example here 

    Patch( Customers, Lookup( Customers, Name = "Contoso" ), { Phone: “1-212-555-1234” } )

    The Lookup() function is used to specify the record to be patched.  Please check this resource https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-patch for more examples of how to add a new record to a datasource and how to modify an existing record. 

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 Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Valantis Profile Picture

Valantis 477

#2
WarrenBelz Profile Picture

WarrenBelz 341 Most Valuable Professional

#3
11manish Profile Picture

11manish 317

Last 30 days Overall leaderboard