cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
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
Super User III
Super User III

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

Community Support
Community Support

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
Super User III
Super User III

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

Community Support
Community Support

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

Frequent Visitor

@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!!

Thanks @jrmarquard ,

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

Done! Hadn't realised

Helpful resources

Announcements
New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

New Power Super Users

Congratulations!

We are excited to announce the Power Apps Super Users!

Power Apps Community Call

Power Apps Community Call: February

Did you miss the call? Check out the Power Apps Community Call here.

Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

Top Solution Authors
Top Kudoed Authors
Users online (72,265)