How to create generic microflow that will take string as input and give string as output

I have a table that contains Key value pair. My requirement is that I want to pass key and get the value. How to achieve this? I know we can achieve this using microflows .But I have to create several microflows for each different values. Is it possible to create a generic microflow which I can use everywhere?
2 answers

Maybe I'm misunderstanding, but in the microflow, retrieve from database the first object with xpath [KeyAttribute = $InputParameter] and then return it's value?


Hey Khushboo,


You can create a Java action, which will take 2 parameters as input. String Key and Type Parameter of Entity type. So in 2nd parameter, you will pass in which entity does the lookup need to perform for the key and that type parameter will be your output as well.


Inside Java action, you can Core.retrieveXpathQuery() method to retrieve value of the key. This will return output of as IMendixObject and then later you need to cast this to output entity it will be returning.


All Mendix objects generalize the IMendixObject class.

Hope this helps.



Naman Khard