Send enumeration via API

0
Hi, Is there a way to send an enumeration over API? (I know it is possible ;) ) I have an enumeration of 15 keys/captions. I need to send the value over a api from App A to App B to be able to retrieve the head in App B. I don’t want to build a else if structure because it would be hard coded and those valued might change one day…   Any idea? Thanks!
asked
3 answers
0

Use the getKey() function. Bear in mind that all keys need to match exactly in both apps so that you don’t get errors.

answered
1

Hey Jeremie,

I think there might be ways, but another option could be to use a Java snippet to map the enum for you.

It requires no if/elsing in the mapping and grows with new values. Check this blog for it's implementation: String to enum: Java snippet - Dennis Kho's Mendix Blog (mxblog.nl)

answered
0

Jannes way works perfectly :) 
But I’ll definitly look at the post Louis.

Thanks for the input ;)-

answered