Create entries in a LookupTable using Rest API

Copper Contributor



I'm trying to add entries to a project online lookuptable using REST. I'm able to create a project via similar commands, however I cannot get the body correct to "post" the additional entry(s) to the lookup table. 


The remote server returned an error: (400) Bad Request.


I think its the Value I cannot get correct, which may be related to SP.KeyValue.

REST Interface



POST Example (not all fields may be required)

body = {
	'parameters': {


2 Replies
Update Any Ideas???, changed URL to'{tableid}')/Entries

"Description": "TEST REST DESC",
"Id": "b5379034-aa95-4a05-8dd4-cfed03614d99",
"SortIndex": "0",
"Value": {
"DurationValue": null,
"NumberValue": 0,
"TextValue": "TEST REST"

Content-Type - application/json;odata=verbose
An entry without a type name was found, but no expected type was specified. To allow entries without type information, the expected type must also be specified when the model is specified.


Content-Type - application/json

The property 'Value' does not exist on type 'PS.LookupEntry'. Make sure to only use property names that are defined by the type.
best response confirmed by Paul Mather (MVP)

Worked it out in end, started off very simple body, the journey took me down the long and frustrating path to complex body with content-type using application/json;odata=verbose. Nailed it today with the below simple body and content-type just application/json.

For anyone wanting to add an entry to lookup table within project online the below if the URL and body required ensuring the GUID is unique for each entry.'{tableid}')/Entries/Add



$lookupguid = [Guid]::NewGuid()


$body = "{ 'parameters':
{'Description': 'TEST REST DESC',
'Id': '$lookupguid',
'SortIndex': '0',
'Value': {
'DurationValue': null,
'NumberValue': '0',
'TextValue': 'TEST REST'