CSOM who to convert my drop-down field's choices into terms

Steel Contributor

I have a field of type Choice with these options:-

Open
In-progress
Approved
Rejected
Cancelled
On-Hold
..
..
..
Closed

 

and i want to convert this site column into a managed metadata column. so i created a new site column of type managed metadata and i link it to a new term set which contain the above choices as terms. but i am not sure how i can write a CSOM code to do the conversion from the choices to terms, mainly the following:-

1- Get the term's GUID based on the term name (choice name).

2- Assign the GUID to the managed metadata field.

any advice on this please?

thanks

0 Replies