web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / how do I patch an item...
Power Apps
Answered

how do I patch an item that I've created using the addcolumn function?

(0) ShareShare
ReportReport
Posted on by 58

I've used the addcolumn function here: (This code sits in the items part of the gallery)

 

AddColumns(
 Students,
 "Here?","Yes")

However, I am unable to amend the column value to either yes, no or late using a patch.

 

I'm trying to do it on a button press within a gallery . Any help would be greatly appreciated. 

Categories:
I have the same question (0)
  • v-mengmli-msft Profile Picture
    on at

    Hi @jjanowskiRR ,

     

    The table returned after using AddColumns cannot be used to update records, you need to save the result as a collection first, and then update the collection.

    ClearCollect(COL,AddColumns(
     Students,
     "Here?","Yes"))

     

    Best regards,

    Rimmon

  • jjanowskiRR Profile Picture
    58 on at

    Thanks - I am struggling to update the buttons and have any success. Where should I put the code above, in the gallery items or on the button itself? Neither is yielding any success - Thank you for taking the time to offer your help

  • v-mengmli-msft Profile Picture
    on at

    Hi @jjanowskiRR ,

     

    You can put it on OnVisible of screen and change Items of gallery to the collection.

    Your original Patch formula should work.

    If above doesn't fix your problem, please provide some screenshots about your app and Patch formula.

     

    Best regards,

    Rimmon

  • jjanowskiRR Profile Picture
    58 on at

    I've managed to make it work. I've got the gallery to update the attendance register by filtering in students from a master list. Thank you for your help. I'm now stuck on how to reset the student list back to its original state so when a teacher takes a register the next day it doesn't show the last set of data...

    ForAll(
     Gallery4.AllItems,
     Patch(
     Students,
     LookUp(Students, Name = ThisRecord.Name,{status: "x"})))

     

    I'm using status: x as it didnt like the blank(), or status: "". the error im getting is attached. Any ideas?

     

  • Verified answer
    v-mengmli-msft Profile Picture
    on at

    Hi @jjanowskiRR ,

     

    Please try this.

    ForAll(
     Gallery4.AllItems As C,
     Patch(
     Students,
     LookUp(Students, Name = C.Name),{status: "x"}))

     

    ——————————————————————————————————————————————

    If my answer helps you solve the problem, please accept it as a solution.

    If you have another question, please post it as new question in the forum.

     

    Best regards,

    Rimmon

     

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 721 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 320 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard