cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Chrisguff12
Resolver I
Resolver I

Updating SharePoint list.

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.

 

1 ACCEPTED SOLUTION

Accepted Solutions

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.

View solution in original post

3 REPLIES 3
WarrenBelz
Super User
Super User

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.

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

 

 

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.

Helpful resources

Top Solution Authors
Top Kudoed Authors
Users online (3,572)