How to Retrieve Only Specific Attribute Values in a Microflow?

0
There is an entity named Worksheet with three attributes: Name, Age, and Position. In a Microflow, I only want to retrieve all the Age values. How can I achieve this?
asked
5 answers
0

Hi Jeff Yu,

 

Data contains an Age value of 18 try this

image.png

 

Check the Documentation Excel Importer

 

Video : Excel import in mendix

answered
1

Hi Jeff Yu , 

 

You need to use an OQL query because retrieving specific attributes directly isn't possible with a regular database retrieve action in Mendix. By default, retrieve actions fetch entire objects, but OQL allows you to fetch only specific attributes.

 

For Example : 

 

SELECT Age FROM MyFirstModule.Worksheet 

 

this query will helps you to get all the list of age are available in your table.  

in the exequete oql statement use worksheet as the return entity

image.pngimage.png

answered
1

Hi jeffu,

          

  • Retrieve: Retrieve   worksheet (All or filtered).
  • Create List: Create a list of   integer  type to hold the age  values.
  • Loop: Iterate over the retrieved   worksheet list.
  • List Add: For each     worksheet, add the    age to the list.

The result is a list of all  age values.

answered
0

image.png

This is my current Worksheet. I will upload an Excel file that contains six headers, which correspond exactly to the attributes A, B, C, D, E and F. Among the headers in the Excel file, there is one named "Age". I want to first identify the attribute in the Worksheet entity that corresponds to "Age", then retrieve this attribute and loop through its data to display it.

If my explanation is unclear, please let me know. Thank you!

answered
0

Hi Jeff,

Please read this blog how you can start your OQL journey.

https://medium.com/@mohammad.saqib_1262/oql-series-part-1-introduction-to-object-query-language-in-mendix-213a0ff132a6

answered