Create variable (with microflow?)

0
Hi,  I'm pretty new to Mendix so trying to figure out something: I got a page where people fill in their first name and than their second name. I want to create a variable on the background which is called: FullName (which consists of first name + second name).  I tried to solve it with a microflow, but since the data isn't stored in the database yet, I can't retrieve the current input of the 2 textboxes yet. How can I solve this most easy way?   Gr, Roel
asked
5 answers
2

Hi Roel,

For example, Consider an entity with firstname, lastname and fullname as a attributes. In your page , you are providing an option to edit firstname and lastname. To Update fullname based on the provided inputs,

As you mentioned, In your onchange microflow pass the current object which is used in the page. In the same microflow, use change object microflow to update full name of the object. 

The following documentation will help you to understand what change object actvity does.

Thanks 

answered
1

Use a on change microflow on both attributes. Set the entity containing the attributes as parameter. Then in the microflow check if both strings are filled and then fill the fullname attribute and commit and refresh. You could show the fullname attribute (temporarily) to check if everything works as expected.

Regards,

Ronald

 

answered
0

I think you are retrieving from database, you should retrieve by association as both the variables are in the memory yet and not stored in database.

 

Regards,

Harsh

answered
0

Got the textboxed filled, ty! Still getting an error I have to fix though :-(

answered
0

Hi Roel,

          When you have a page for first name and last name, after input you need to have some save button. In that give option for call a microflow. There by default you will get the object that needs to be saved. There first check ($object/firstname != empty) & ($object/lastname != empty). If both passed , you create a variable to add these 2 to have full name. If you want to store the fullname, create an attribute for fullname in the entity and commit the object at the last

Hope it helps !!!

answered