Skip to main content

Notifications

Power Apps - Building Power Apps
Answered

Updating SharePoint list.

Posted on by 223

Hello,

                I am trying to update a few fields on my SharePoint list using a button to active the changes on records that have been checked off. I have a formula with no errors, but it doesn’t work. I’m not sure if I need the "@" symbols or not. Either way the records don’t update.

                When the records update the ReportID should reflect the value in Orange. And ItemStatus should change from “New” to “Reviewing”.

i have tried to change ItemStatus to {ItemStatus: "Reveiwing",} but I get a warning "the type of this argument 'ItemStatus' dose not match the expected type 'Record'. Found type 'Text'." 

 
 

Current formula.

 

ForAll(
 Filter(
 New_Supply_Request_Gallery_1.AllItems,
 [@Confirm_Item_Checkbox1_1].Value
 ),
 Patch(
 'Expense LineItems',
 Defaults('Expense LineItems'),
 {
 ItemStatus: [@Item_Status_Supplies_Lists_Label9_1],
 ReportID: [@Report_ID_Supplies_List_Label1_1],
 ID: Value(CountRows('Expense LineItems') + 1)}))

 

 

 

Chrisguff12_0-1615504630879.png

Thanks for any help.

 

Categories:
  • Verified answer
    WarrenBelz Profile Picture
    WarrenBelz 143,246 on at
    Re: Updating SharePoint list.

    Hi @Chrisguff12 ,

    Try

    ItemStatus {Value:"Reviewing}

    Also you cannot Patch to the ID field in a SharePoint list.

     

    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
    Chrisguff12 223 on at
    Re: Updating SharePoint list.

    Hello @WarrenBelz 

     

    Expense Line items is a list. I tired your formula and I am getting all red lines, with the same error "the type of this argument 'ItemStatus' dose not match the expected type 'Record'. Found type 'Text'." and the same for ReportID. When I remove the ".Text" from the end of ItemStatus and ReportID the red lines go away, but it still doesn’t update the “Expense Line Item” list.

     

    more info on my app

    I tried to replicate the sample app "Expenses" from power apps. So I have two lists “Config Expenses” which has the expense reports and “Expense Line Items” which has all of the individual items that are being ordered. 

     

    I'm Pulling the ID # from Configs Expenses and then trying to assign it to the ReportID field of the item in Expense Line Item.  Then I am trying to change ItemStatus to "Reviewing".

     

    Chrisguff12_0-1615515680511.png

     

     

  • WarrenBelz Profile Picture
    WarrenBelz 143,246 on at
    Re: Updating SharePoint list.

    Hi @Chrisguff12 ,

    Is 'Expense LineItems' is a Collection or a List? You cannot Patch a value to the ID of a SharePoint list as this is a built-in auto-incrementing number. Also are you trying to increment the ID dynamically? Firstly try this

    ForAll(
     Filter(
     New_Supply_Request_Gallery_1.AllItems,
     Confirm_Item_Checkbox1_1.Value
     ),
     Patch(
     'Expense LineItems',
     Defaults('Expense LineItems'),
     {
     ItemStatus: Item_Status_Supplies_Lists_Label9_1.Text,
     ReportID: Report_ID_Supplies_List_Label1_1.Text,
     ID: CountRows('Expense LineItems') + 1
     }
     )
    )

     

    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.

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,246

#2
RandyHayes Profile Picture

RandyHayes 76,308

#3
Pstork1 Profile Picture

Pstork1 63,884

Leaderboard