3

I have Custom list in which i have one Multi lookup column in that user select data from front end then i have to add that data in lookup column.

But if user not select any data then i have to add null or blank.

So how can i do this.

I am using REST API for POST Request.

Any Help highly Appreciated.

4
  • 2
    Just do not specify the lookup column in the request body. That's all Sep 1, 2016 at 5:03
  • that i know .but have other value also in body. i have to create two request body if it null then without it and if have value then other. Sep 1, 2016 at 5:10
  • i am thinking like if i pass "" or "null" or other so i didnt need to create multiple request body as per condition. Sep 1, 2016 at 5:11
  • You can pass null also. see my answer. Sep 1, 2016 at 5:33

2 Answers 2

5

Just do not specify lookup column in request body or set lookup value to null

{
"__metadata": {"type": "SP.Data.[List Name]ListItem"},
"Title": "[Title]",
"[Internal Name of lookup the column]Id": null
}
1
  • if i want textfield as null then how can i pass null?? Jun 14, 2017 at 7:22
0

In multi lookup column i have passed value like below and its works.

"[Internal Name of lookup the column]Id": {'results':[]}

In single item look up you have to passed like below as per @AtishDipongkor Answer

"[Internal Name of lookup the column]Id": null
2
  • That means your lookup column allows multiple value. You have not mention in the question! Sep 1, 2016 at 15:35
  • @AtishDipongkor sorry i forgot to mention. Sep 2, 2016 at 4:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.