Value out of option set returns null

Hello there,

I am passing an object into my plugin that contains a data type that is using an option set. Within this option set there is a nested option set. When doing a console log on the right field it returns null even though it is present in my db.

I do the following console.log → console.log(item.get(“coretalent_option_coretalents”).get(“category”).get(“display”))

this would narrow it down to a display name in an optionset that is present in my db but it logs ‘null’.

Anyone that has encountered this problem?

Are you sure your field names are correct? Have you console logged the “listProperties()” function?

I have but still the output is null. I have double checked but still no luck.

As of plugin api V4 the gets are returning promises, so you’ll need to await them (or resolve them some other way)

Edit - I assumed server action, so discard my answer if you are doing a client action.

Huh. Didn’t know that. Good to know. Thanks

My option set was imported from another app. This had put it into a vague state where it was deleted but not really. Deleting the option set and manually making it again solved this issue.