Hi,
My Patch() function is throwing an error "lhci: Field 'lhci' is required.".
Screenshot (edit):
Screenshot (published app):
I have no clue what "lhci" is. Tried searching online but can't find anything.
These are the columns for the SharePoint list:
Doesn't turn up under the SharePoint view options either
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
Solved! Go to Solution.
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.
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.
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
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.
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.
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
@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
User | Count |
---|---|
221 | |
99 | |
93 | |
55 | |
37 |
User | Count |
---|---|
272 | |
105 | |
104 | |
60 | |
59 |