How to Create a Entity with List Item values from JSON


I am getting few values from an API called within a service node. I want to see the options in a entity node based on the data that I get from the API.
How do I achieve this?

I tried to add a Entity with type List Enumerated and within the settings, used the option “List from Context” where I provided the value as context.ServiceNodeName.response.body as this variable gets the response back.

But when I run the bot, I am not able to get any choices back. I have also enabled “Yes, use channel specific standard formatting for default messages and show available list of values to end user.” but I do not get any values for selection to the user.

Can someone help me resolve this please?

Did you see the documentation on LOV enumerated entity types?

As long as you have a variable like the below in the context, you can use it in the Entity LoV to populate the values dynamically

context.myLOVEntityValues = [
       "title" : "Option 1",
       "value" : "opt1",
       "synonyms" : ["option 1", "first one"]
       "title" : "Option 2",
       "value" : "opt2",
       "synonyms" : ["option 2", "second one"]