cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Anonymous
Not applicable

Patch a simple SP list

I've got a simple list with the following columns:

 

QRef - Text

From - Choice

To - Choice

QType - Choice

Number Sent - Number

Despatch Date - Date

Reference - Text

Received? - Checkbox

Number Received - Number

 

There are two types of users: The senders and the receivers

 

The senders only need to fill in From, To, QType, Sent, Date, Reference

The receivers only need to fill in Received, Number Received

 

When a sender form gets submitted, Flow creates the QRef based on the ID number of the row..ie QR_1 for ID 1.

 

In the first EditScreen (sender Form), I remove the Received and NumRec cards.

I then added a second EditScreen1_1 with Qref, Received, Number received.

 

My goal is when the Receivers edit the EditScreen1_1, they type in the QRef (from the email they received from flow), flick the switch to Received and the number received.

 

On the Submit button I have attempted to create Patch command, but I can't get it to work. I generally get "Invalid Argument type (Table) Expecting a Record"

 

The examples I've seen online seem to work on tiny datasets and I'm assuming there's something specific I need to do because of SP, but I don't know what it is.

 

7 REPLIES 7
Highlighted
Community Champion
Community Champion

Re: Patch a simple SP list

Hi @Anonymous

Nothing specific about SP, should work.  What is the code you use for the patch?

Highlighted
Anonymous
Not applicable

Re: Patch a simple SP list

Hi,

 

here is the code I attempted. I've got a screen with:

 

Qref - text

Received - checkbox

Number Received - number

 

Patch('SPList', First(Filter('SPList', Qref = BrowseGallery1.Selected.Qref)), {Received_x003f_:DataCardValue10}, {Number_x0020_Received:DataCardValue16})

 

The receiver would have received an email with the Qref number and should enter it in the text box as well as saying Yes and putting a number.

 

I get an error on submit saying "A value must be provided for item"

 

 

Highlighted
Community Champion
Community Champion

Re: Patch a simple SP list

I would suggest hardcoding values instead of variables and see if you still get an error and of what type, something like this:

Patch('SPList', First(Filter('SPList', Qref = "QR_1")), {Received_x003...: true}, {Number_x0020_Recei...: 99})

(Due to the mess up in graphics with smileys I couldn't get the column names properly.)

 

For example it could be that you need to use 0 or 1 instead of true, of that the checkbox has a null value that throws an error.

 

Please let me know

 

Highlighted
Anonymous
Not applicable

Re: Patch a simple SP list

Nothing happens 😕

 

I don't get an error and the list isn't updated.

Highlighted
Anonymous
Not applicable

Re: Patch a simple SP list

I just went back and had another look.

 

I realised I had a space between the quote and Qref.." Qref"

 

I removed it and now I get the same error with the hardcoding.

Highlighted
Community Champion
Community Champion

Re: Patch a simple SP list

OK, then I suspect it may be some issue with the SP connector and you need to find a work-around.

You could try the UpdateIf function instead to see if that helps.

Highlighted
Anonymous
Not applicable

Re: Patch a simple SP list

I've tried for a couple of hours with various cominations of UpdateIf.

 

I did a simple one which worked but it updated every row, so I tried adding Filter() and First(Filter)) but I get an error which says "The specific data source cannot be used"

 

 

UpdateIf(Filter('SPList', QRef = BrowseGallery1.Selected.QRef), QRef = BrowseGallery1.Selected.QRef, {Received_x003f_:DataCardValue10.Value}, QRef = BrowseGallery1.Selected.QRef, {Number_x0020_Received:Value(DataCardValue16.Text)}

 

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Watch Now

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (6,667)