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

Patch error

Hello,

I am dealing with a Patch error. 

Error warning: MasterID does not match expect type "record". Found type Number.
Thought Value formula would fix issue.

 

Current Formula:

ForAll(GatewayCollection, Patch(GatewayTest, Defaults(GatewayTest), {MasterID: ProgramForm.LastSubmit.ID})

I tried inserting a Value in front of ProgramForm.LastSubmit.ID; however, not working. 

ForAll(GatewayCollection, Patch(GatewayTest, Defaults(GatewayTest), {MasterID: Value(ProgramForm.LastSubmit.ID)})

 

My longer formula works just trying to get the MasterID Lookup field from One SP list to be inserted into the other SP List for each row. 

ForAll(GatewayCollection, Patch(GatewayTest, Defaults(GatewayTest), {Gateways:Gatewaysdrop, 'VPP Date': DateValue('VPP Date'), Comments: Comments}))

 

I was able to figure out needed to put DateValue in. Struggling with this last portion. 

 

Any suggestions appreciated. Thank you.

Kevin

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted

@kgordish 

So there is the issue.

You are trying to Patch a Lookup column in your List 2.

Change your formula to the following:

ForAll(GatewayCollection, 
    Patch(GatewayTest, Defaults(GatewayTest), 
       {
        Value: ProgramForm.LastSubmit.ID,
        Id: ProgramForm.LastSubmit.ID,
        '@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference"
       }      
    )
)

 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too!

View solution in original post

6 REPLIES 6
Highlighted
Resolver II
Resolver II

What type of column is MasterID?

 

The error you are getting is saying it wants a Record type instead of a Number. This would look like this:

ll(GatewayCollection, Patch(GatewayTest, Defaults(GatewayTest), {MasterID: ProgramForm.LastSubmit})

 

ProgramForm.LastSubmit is a Record type while ProgramForm.LastSubmit.ID is a Number type.

 

Try that and see what happens to your patch?

Highlighted
Super User III
Super User III

@kgordish 

What is the definition (column type) of your MasterID column?

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too!
Highlighted

@DylanSimons 
SharePoint List 1: Normal ID Column
SharePoint List 2: MasterID (LookUp ID to List 1)

Essentially trying to replicate this:

https://www.youtube.com/watch?v=xgznk4XlPCo

Min 25:30 to 26:00 minute mark. 

Highlighted

@kgordish 

So there is the issue.

You are trying to Patch a Lookup column in your List 2.

Change your formula to the following:

ForAll(GatewayCollection, 
    Patch(GatewayTest, Defaults(GatewayTest), 
       {
        Value: ProgramForm.LastSubmit.ID,
        Id: ProgramForm.LastSubmit.ID,
        '@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference"
       }      
    )
)

 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too!

View solution in original post

Highlighted

@RandyHayes Thank you PowerApps Professor. 

I was still having issues, but realized I could achieve same functionality without actually having a Look up column. 
Thank you for pointing me in the right direction. Additionally, I was able to watch some videos about complex columns.

Ideally, Microsoft would save everyone's time and remedy the coding issues associated with complex columns. 

 

Again, thanks. 

Highlighted

@kgordish 

Glad you sorted it all out.

 

Actually PowerApps does pretty well with complex columns.  This is surfaced well in the EditForm - it's worth using just for that fact alone.  It's usually when something in the app needs some special attention that you have to resort to putting in your own formulas to deal with the complex column.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too!

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Community Highlights

Community Highlights

Check out the Power Platform Community Highlights

Top Solution Authors
Top Kudoed Authors
Users online (9,268)