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

Community site session details

Session Id :
Power Apps - Building Power Apps
Answered

SharePoint not updating status

(0) ShareShare
ReportReport
Posted on by 229

I have a gallery that displays expense items that are Pending. I have a checkbox in the form to check off what items are Approved. then a button that will update the ItemStatus field. The formula I have has a delegation error under the = sign and ".text" but the rest looks fine. When I hit the button it doesn't update the field. 

 

"ItemStatus is a "Single line of text" type in a SP list 'Expense App List New'

 

Button Formula

 

ForAll(
 Filter(
 Pending_Expenses_Approval_Gallery_1.AllItems,
 Approve_Item_Checkbox.Value = true),
 Patch(
 'Expense App List New',
 LookUp(
 'Expense App List New',
 RequestID = ID_Label4.Text
 ),
 {ItemStatus: "Aprroved"}
 )
);
Refresh('Expense App List New')

 

 

 

Categories:
I have the same question (0)
  • WarrenBelz Profile Picture
    151,751 Most Valuable Professional on at
    Re: SharePoint not updating status

    Hi @Chrisguff12 ,

    I am not sure where the Delegation Warning is coming from - I assume RequestID is a Single Line of Text?

    Try this as well

    ForAll(
     Filter(
     Pending_Expenses_Approval_Gallery_1.AllItems,
     Approve_Item_Checkbox.Value
     ),
     Patch(
     'Expense App List New',
     {RequestID:ID_Label4.Text},
     {ItemStatus: "Approved"}
     )
    );
    Refresh('Expense App List New')

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

  • Chrisguff12 Profile Picture
    229 on at
    Re: SharePoint not updating status

    @WarrenBelz 

     

    The ReportID is a number field. I am getting a expected a number type. I removed the .Text  to fix the formula, but when I click the button it creates a new Approved record with all other fields are blank.

  • WarrenBelz Profile Picture
    151,751 Most Valuable Professional on at
    Re: SharePoint not updating status

    Thanks @Chrisguff12 ,

    You need

    ForAll(
     Filter(
     Pending_Expenses_Approval_Gallery_1.AllItems,
     Approve_Item_Checkbox.Value
     ),
     Patch(
     'Expense App List New',
     {RequestID:Value(ID_Label4.Text)},
     {ItemStatus: "Approved"}
     )
    );
    Refresh('Expense App List New')

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

  • Chrisguff12 Profile Picture
    229 on at
    Re: SharePoint not updating status

    @WarrenBelz 

    Hello, Warren I still only makes a new record.

  • WarrenBelz Profile Picture
    151,751 Most Valuable Professional on at
    Re: SharePoint not updating status

    @Chrisguff12 ,

    What is the actual field value behind ID_Label4? If it is the RequestID, you can do this

    ForAll(
     Filter(
     Pending_Expenses_Approval_Gallery_1.AllItems,
     Approve_Item_Checkbox.Value
     ) As aExpense,
     Patch(
     'Expense App List New',
     {RequestID:aExpense.RequestID},
     {ItemStatus: "Approved"}
     )
    );
    Refresh('Expense App List New')

     The syntax is correct to update a record as long as you have a match on the first part.

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

  • Verified answer
    Chrisguff12 Profile Picture
    229 on at
    Re: SharePoint not updating status

    @WarrenBelz 

     I read your Blog “Power Apps Delegation – SharePoint” last week and I tied to follow your advice on shadow IDs. I made a simple Number field in SP and named it RequestID. Then for the “OnSuccess” property of the form when submitting a new request, I have a version of your formula.

    UpdateContext({locShowSpinnerINFIN: false});
    Patch(
     'Expense App List New',
     {ID: New_Supply_Requests_Form.LastSubmit.ID},
     {RequestID: New_Supply_Requests_Form.LastSubmit.ID}
    );
    ResetForm(New_Supply_Requests_Form)

    So “ID_Label4” is just has ThisItem.RequestID in the Text property.

     

    As I am looking at your Blog again now, I think that I am missing the rest of the pieces to make the Patch function work. I’m not sure where to put the “Set(VLASTID….”  piece.

  • WarrenBelz Profile Picture
    151,751 Most Valuable Professional on at
    Re: SharePoint not updating status

    Hi @Chrisguff12 ,

    Assuming you have this unique numeric identifier in every record and it is also in the data forming the gallery, then the last code I supplied should work.

    I don’t quite understand you last question as it does not relate to this thread.

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

  • Chrisguff12 Profile Picture
    229 on at
    Re: SharePoint not updating status

    @WarrenBelz 

     

    I want to thank you for your patience but I’m still not able to get this to work and I’m sure it’s on my end and not with the formula that you provided.  I am going to go another way with my status changes and use forms to update the records.

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Chiara Carbone – Community Spotlight

We are honored to recognize Chiara Carbone as our Community Spotlight for November…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 652 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 410 Super User 2025 Season 2

#3
developerAJ Profile Picture

developerAJ 236

Last 30 days Overall leaderboard