How can I add option cms fields using nodejs webflow API

I found a workaround after some tries. But for this to work you need to set values if its option set values and in case of multi reference set new collection and reference it to the collection you want .
Then manually create item in your present collection and set values to one of the item or set multi reference values to the field. then when you call below function you can see the manual values(ids) you set in option field and array(ids) like format in case of multi references.

const items = webflow.items({ collectionId: ‘xxxxxxxxxxx’ }, { limit: 1 });
items.then(i => console.log(i[‘items’]))

Then you can use webflow.createitem and in fields
if its option
“category”:‘xxxxxxx’ (id you got by manually enterring information)
in case multi reference
“Tags”:[‘xxxxx’,‘xxxxx’] (you get multi ids)

You can use this predefined ids to update same future values. In short webflow assigns ids the first time you enter values which should be fixed

Note:- only works if you want to add automatic predefined values using api you need to set manually fields first and check ids. In case of multi reference you can automate but needed to create collection manually and can then enter items into it using webflow create item and then get ids webflow.items by above command and then assign the ids to your present collection lot of work to do…

Do let me know if anyone has better method .Since I am new to webflow api and couldnt find any solutions online I wanted to share my experience so that others wont experience similar problems