cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Frequent Visitor

Patch error "missing required field" for field that doesn't exist

Hi,

 

My Patch() function is throwing an error "lhci: Field 'lhci' is required.".

 

Screenshot (edit):

 

Screen Shot 2020-05-26 at 12.47.33 pm.png

 

Screenshot (published app):

Screen Shot 2020-05-26 at 1.03.20 pm.png

I have no clue what "lhci" is. Tried searching online but can't find anything.

 

These are the columns for the SharePoint list:

Screen Shot 2020-05-26 at 12.48.19 pm.png

 

Doesn't turn up under the SharePoint view options either

Screen Shot 2020-05-26 at 12.58.01 pm.png

 

The only other place I can see it referenced is using the REST API to pull the items on the list with ?expand=fields, the field looks like a user lookup field, "lhciLookupId".

 

...,
"fields": {
                "@odata.etag": "\"3648565f-6a0f-43b7-8cd5-2628db6abc0f,7\"",
                "Title": ".",
                "lhciLookupId": "6",
                "OvertimeType": "Overtime (paid)",
                "OvertimeDate": "2020-05-10T14:00:00Z",
                "ApprovedByLookupId": "22",
                "Break": 30.0,
                "OvertimeDateNumber": 20200511.0,
                "StartTime": "2020-05-11T08:00:00Z",
                "EndTime": "2020-05-11T09:00:00Z",
                "IsDeleted": false,
                "Status": "ConfirmedAndApproved",
                "id": "30",
                "ContentType": "Item",
                "Modified": "2020-05-20T05:58:26Z",
                "Created": "2020-05-11T06:54:24Z",
                "AuthorLookupId": "6",
                "EditorLookupId": "6",
                "_UIVersionString": "1.0",
                "Attachments": false,
                "Edit": "",
                "LinkTitleNoMenu": ".",
                "LinkTitle": ".",
                "ItemChildCount": "0",
                "FolderChildCount": "0",
                "_ComplianceFlags": "",
                "_ComplianceTag": "",
                "_ComplianceTagWrittenTime": "",
                "_ComplianceTagUserId": ""
            }
}

 

 

Other notes:

- I can create a new record in Sharepoint without errors.

- This happens in both the editor and using the app when it's published under different users

 

I've tried:

- closing down the app editor (Chrome, Mac).

- removing all Sharepoint connections and re-adding them

 

At a loss. Any help appreciated.

 

Cheers,

John

2 ACCEPTED SOLUTIONS

Accepted Solutions
Highlighted
Community Champion
Community Champion

Re: Patch error "missing required field" for field that doesn't exist

Hi @jrmarquard ,

Might be a wild guess here, but SharePoint retains the name the field was originally created with, even after you change it. Try removing all the required fields and see if it works. If do, hover over each on and look at the string on the bottom of the screen and at the end you will see the "internal" name.

 

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

Highlighted
Community Support
Community Support

Re: Patch error "missing required field" for field that doesn't exist

Hi @jrmarquard ,

 

After a simple comparison, you can see that lhci is most likely the Employee column. The Person column is also LookUp type in some sense, and the lookupid of lhic, Author and Eidtor are all 6, that means they are all the same person, which can confirm our assumption in a further step.

Snipaste_2020-05-26_15-11-11.png

As @WarrenBelz mentioned, SharePoint prefers the initial column name, although you have renamed the column name, but in Web API and Power Apps, it still applies the initial column name.

 

Please go to check if the required Employee column misses in your Patch function?

Hope this helps.
Sik

 

View solution in original post

5 REPLIES 5
Highlighted
Community Champion
Community Champion

Re: Patch error "missing required field" for field that doesn't exist

Hi @jrmarquard ,

Might be a wild guess here, but SharePoint retains the name the field was originally created with, even after you change it. Try removing all the required fields and see if it works. If do, hover over each on and look at the string on the bottom of the screen and at the end you will see the "internal" name.

 

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

Highlighted
Community Support
Community Support

Re: Patch error "missing required field" for field that doesn't exist

Hi @jrmarquard ,

 

After a simple comparison, you can see that lhci is most likely the Employee column. The Person column is also LookUp type in some sense, and the lookupid of lhic, Author and Eidtor are all 6, that means they are all the same person, which can confirm our assumption in a further step.

Snipaste_2020-05-26_15-11-11.png

As @WarrenBelz mentioned, SharePoint prefers the initial column name, although you have renamed the column name, but in Web API and Power Apps, it still applies the initial column name.

 

Please go to check if the required Employee column misses in your Patch function?

Hope this helps.
Sik

 

View solution in original post

Highlighted
Frequent Visitor

Re: Patch error "missing required field" for field that doesn't exist

@v-siky-msft @WarrenBelz On the money - big thanks for your help.  Employee column was missing. Adding

"Employee": { ... etc }

to my Patch() fixed the issue.

 

Cheers!!

Highlighted
Community Champion
Community Champion

Re: Patch error "missing required field" for field that doesn't exist

Thanks @jrmarquard ,

You can choose to accept more than one response - totally up to you.

Highlighted
Frequent Visitor

Re: Patch error "missing required field" for field that doesn't exist

Done! Hadn't realised

Helpful resources

Announcements
August 2020 Community Challenge: Can You Solve These?

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

secondImage

Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

secondImage

Super Users Coming in August

We are excited for the next Super User season.

secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

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,626)