Dynamic Attributes in an entity

1
I am calling an API using call REST, now if on different condition different attributes are returning from that API. So now because attributes are different every time, so I want an entity whose attributes can change based on the result of that API. Basically, I need an entity with dynamic attributes
asked
1 answers
2

You can’t have dynamic attributes, but you may be able to fake it using a list of simple entities that have a key and value attribute that you populate. I’m not sure that is very practical though.

If the number of attributes are fixed, you could create a larger entity that can hold the different attributes. To populate this you could create a fake JSON entity with all the possible attributes set, and define an input mapping based on this.

Another approach if you know which attribute triggers which response is to create a different series of import mappings that you can use depending on the data you are expecting for that attribute.

Hope this helps.

answered