cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
AchalDesai
Helper I
Helper I

For All Patch(Update) SP List With Value in a collection

Hi All,

I am having trouble with patching a sharepoint list.

 

I am collecting the ID and a Status from a gallery where change was made in a dropdown. (image below for reference)

AchalDesai_0-1629813229157.png

As you see, the 2 records with the checkboxes ticked have been added to the collection (Only the Eshop Package Ref and the New status from the dropdown. (Collection image for reference below)

AchalDesai_1-1629813346851.png

Now what I need to do it is update the Current Ops Status column in the SP list with the new selected status that is in the collection. 

I have used this below formula but it is giving me the following error ["The type of this Argument 'OperationsStatus' does not match the expected type 'Record'. Found type 'Text'"]

 

 

ForAll(
    RenameColumns(
        SelectedGalItems,
        "EshopPackageReference",
        "EshopPkgRefs"
    ),
    Patch(
        LostPackagesDB,
        First(
            Filter(
                LostPackagesDB,
                'Eshop Package Reference' = EshopPkgRefs
            )
        ),
        {'Operations Status': OpsNewStatus}
    )
)

 

An Important note, The 'Operations Status' column on the SharePoint list is a Choice column. from the error description, I think this might be causing the issue.

1 ACCEPTED SOLUTION

Accepted Solutions
zmorek
Super User
Super User

Try

{
'Operations Status': {Value:OpsNewStatus}
}

View solution in original post

6 REPLIES 6
PG_WorXz10
Resident Rockstar
Resident Rockstar

Hi @AchalDesai ,

 

Is Operations Status choice field ?

If this post was helpful or you need more help please consider giving Thumbs Up and Tag me in your reply I'll be happy to help. If this post helped you solve your issue please click Accept as solution and provide Thumbs Up. This will help others find it more readily.

Hi @PG_WorXz10 , Yes Operations Status is a Choice field on the SharePoint List Side

zmorek
Super User
Super User

Try

{
'Operations Status': {Value:OpsNewStatus}
}

Hi @AchalDesai ,

 

May be below code will work. 

 

				ForAll(
    RenameColumns(
        SelectedGalItems,
        "EshopPackageReference",
        "EshopPkgRefs"
    ),
    Patch(
        LostPackagesDB,
        First(
            Filter(
                LostPackagesDB,
                'Eshop Package Reference' = EshopPkgRefs
            )
        ),
        {'Operations Status': 
		        {
                    '@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",
                    Value: OpsNewStatus
                }
		
		
		}
    )
)

 

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.

If this post was helpful or you need more help please consider giving Thumbs Up and Tag me in your reply I'll be happy to help. If this post helped you solve your issue please click Accept as solution and provide Thumbs Up. This will help others find it more readily.

StalinPonnusamy
Super User
Super User

Pls try this

ForAll(
    RenameColumns(
        SelectedGalItems,
        "EshopPackageReference",
        "EshopPkgRefs"
    ),
    Patch(
        LostPackagesDB,
        First(
            Filter(
                LostPackagesDB,
                'Eshop Package Reference' = EshopPkgRefs
            )
        ),
        {
'Operations Status': {Value:OpsNewStatus}
}
    )
)

This worked thanks!!.

I figured the choice field was causing the problem. But didn't know how to convert the text to a record.

Helpful resources

Announcements
PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

Top Solution Authors
Top Kudoed Authors
Users online (1,699)