Sort and Count Input Microflow

0
Hi, I'm wondering if it is possible to have a microflow that goes as follows: 1) Retrieve answers which have been inputted through a text box from a 'Form' type page. 2) Records and sorts the answers based on the specific string answers (e.g. recognises "Ford" apart from "BMW") 3) Counts the number of each specific input, e.g. "Ford"=3 and "BMW"=4, as 3 Ford answers and 4 BMW answers are entered in the text box. 4) Stores the number in a separate integer attribute. This will then be used to plot a chart with the integer (e.g. 3) against the input class (e.g. Ford) Is Mendix capable of doing this? Thanks in advance!
asked
3 answers
0

Edric,

Yes, Mendix can do this.  The first part of your question has to do with how to create a data entry app in Mendix.  You can learn how to do this in the following Learning Path: https://gettingstarted.mendixcloud.com/link/path/10  In particular, this module covers how to create pages for gathering data: https://gettingstarted.mendixcloud.com/link/module/5/lecture/86, this one covers how to create a database to store your information:  https://gettingstarted.mendixcloud.com/link/module/4/lecture/172  And this one gives an introduction to microflows (which you'll need to summarize your data before creating a chart): https://gettingstarted.mendixcloud.com/link/module/8/lecture/116

The second part is about charting data.  This documentation will give you plenty of information about how to do that:  https://docs.mendix.com/howto/extensibility/charts-tutorials

Hope that helps - have fun!

Mike

answered
0

Hi Mike, 

I have went through the tutorials. Here is what I came up with:

1. Create a page with the text box for the user to input its info.

2. Have a retrieve action in a microflow which is able to apply an XPath constraint to filter out the values of "BMW"

3. Have a count action (a part of aggregate list) to count the number of values of "BMW"

4. Store the input in an attribute.

How do I then do the same for "Ford"? If I repeat what I did with "BMW", it will store the input in a separate attribute.

By having multiple attributes, I am unable to use the chart widget as the chart's X and Y each receives one attribute only. Using the above method would give me 1(Car Type, e.g. "Ford", "BMW", etc.) + N (1st Count's Attribute, 2nd Count's Attribute,...) number of attributes instead.

Is there any way for me to store each count attribute's singular integer into rows of a 'Master' attribute? 

answered
0

Edric,

Given a domain model like this:

A microflow like this will process all records in UserEntry entity and create a summary record for each entered brand with the count of how many times it was entered in the CarBrandData entity. 

Then you can view the records of CarBrandData in a datagrid.

Note: I have also shared this microflow using ModelShare - you can view it here: https://modelshare.mendix.com/models/770381ba-a47a-4a29-9893-4a9f2658ab01/forum-question-90745-count-user-entry

Hope that helps,

Mike

answered