How to create objects with dynamic attributes.

0
Hey friends, I need to create an object, let's call it, Template_To_Add_Attributes, where I can assign different attributes every time. In the end, I’m going to use it in order to generate a JSON for consuming a rest service. I don’t know how to create it using directly Studio Pro tools, so my approach now will be create a Java Action and generate my JSON inside. However, I wanted to ask in order to have different approaches and paths. Thanks
asked
1 answers
1

Felix,

Any more info you can provide regarding your use case would be helpful.  Are the attributes completely unknown ahead of time?  Do you have a number of attributes and you might only use a subset of those?  

Thanks,

Mike

*** EDIT ***

you could use a data structure like this, which is what I think you were describing

The difficult thing would be to create the outgoing JSON, unless your service has a generic structure for sending information to be used to send an email.  If it does not, you would probably have to create a JSON string ‘by hand’ in a microflow and include that as the outgoing body of the REST call.  If the email send service has a generic structure, you could import that JSON into Mendix, create an Export Mapping and then populate a set of entities in a microflow to be used by the Export Mapping when you call the REST service.

If you have specific info about the Send Email service, I would be interested to take a look at that and see if I can be more specific.

answered