Parameters of selected micro flow does not match arguments

0
Hi, I'm 2 days new to Mendix so I need little help with one issue. I'm calling a micro flow from a page via an action button, and passing a parameter (Json object with ID that I would like to use in the REST call). So far so good, but I use the same microflow to return a list of objects and populate a grid in another page. Is that possible to do it this way or what do you recommend ? Because I don't know how to pass a parameter to a page, and use that parameter in the micro flow call from the grid. BR, Robert.
asked
3 answers
0

Robert,

One way you could accomplish this:

  1. Create an entity to contain the ID needed for your REST call, you will need to create an object of this entity to be used on your first page.  Lets call this entity Parameters.
  2. When the user clicks the action button (after the ID is filled in), a microflow will be called with the object from your first page as an argument.  You can then get the ID from this object, perform the REST call and get your results.
  3. Create a second entity, lets call this on Results, to contain the object(s) that are returned from your REST call.  Make an association between this entity and Parameters entity.  The association should be 1 to many, i.e. each Parameters object can have many Results objects associated with it.
  4. In your microflow, process the returned objects to create Results objects, don't forget to associate them with your Parameters object.
  5. Now create a page that contains a dataview with the Parameters object and a datagrid nested inside of the dataview. The nested datagrid should point to the Results entity via the association your created between Parameters and Results.
  6. The final step in your microflow should open this page, passing in the Parameters object.

Now your page will display a list of the results your retrieved via your REST call.

This how to takes you through many of these steps, however it anticipates retrieving a single object, not a number of objects:  https://docs.mendix.com/howto/integration/consume-a-rest-service

Hope that helps,

Mike

 

answered
0

Hi Robert,

That error means that the parameters for your microflow don't match the dataview for your page. So for the action button inside the dataview, just make sure it has one parameter (or two if the button is inside both dataviews) and that the parameter is of the same type as the data view. 

If you are trying to call a microflow from a grid, and you want to use a parameter from the grid as well as a parameter from a dataview, then you would add the action button to the control bar of the grid, and you would use two parameters (the grid needs to be inside the dataview). One parameter would be of type of the dataview, and the other would be the same type as the grid. 

 

Also here is a link to the learning modules.

https://gettingstarted.mendixcloud.com/index3.html

Hope this helps!

 

answered
0

Yes !, that worked like a charm.

Thanks !!

answered