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

%3CLINGO-SUB%20id%3D%22lingo-sub-1738558%22%20slang%3D%22en-US%22%3ECSOM%20who%20to%20convert%20my%20drop-down%20field's%20choices%20into%20terms%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1738558%22%20slang%3D%22en-US%22%3E%3CP%3EI%20have%20a%20field%20of%20type%20Choice%20with%20these%20options%3A-%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-applescript%22%3E%3CCODE%3EOpen%0AIn-progress%0AApproved%0ARejected%0ACancelled%0AOn-Hold%0A..%0A..%0A..%0AClosed%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Eand%20i%20want%20to%20convert%20this%20site%20column%20into%20a%20managed%20metadata%20column.%20so%20i%20created%20a%20new%20site%20column%20of%20type%20managed%20metadata%20and%20i%20link%20it%20to%20a%20new%20term%20set%20which%20contain%20the%20above%20choices%20as%20terms.%20but%20i%20am%20not%20sure%20how%20i%20can%20write%20a%20CSOM%20code%20to%20do%20the%20conversion%20from%20the%20choices%20to%20terms%2C%20mainly%20the%20following%3A-%3C%2FP%3E%3CP%3E1-%20Get%20the%20term's%20GUID%20based%20on%20the%20term%20name%20(choice%20name).%3C%2FP%3E%3CP%3E2-%20Assign%20the%20GUID%20to%20the%20managed%20metadata%20field.%3C%2FP%3E%3CP%3Eany%20advice%20on%20this%20please%3F%3C%2FP%3E%3CP%3Ethanks%3C%2FP%3E%3C%2FLINGO-BODY%3E
Highlighted
Valued 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