Add a microflow that triggers onchange, retrieve the associated records.
Add a create variable activity to create a string and then loop over the retrieved records setting the string variable and then use that value to set the attribute via a change object acvtivity.
This should do the trick.
Hi Jeffery,
I'd suggest you to use a microflow in the onChange event that retreives the selected values, create a string variable and loop the selected values in it. Later concatenate the values in the created variable and now store the variable in the desired attribute.
Hi Jaffery,
You can use the multiselect widget, and there you can select the attribute where you want to store the selected object in string format.
This way it will be easier without any extra logic.
Hope it helps!
Let me know if you have any issues,
Hi,
In Mendix, a multi-select combo box / checkbox set stores the selected values in the association, not in the string attribute. So to store all selected companies in a string, you must retrieve the associated objects and concatenate them in a microflow.
1. Domain Model
EntityA - Companies (String) EntityB - CompanyName (String) Association EntityA_EntityB (Many-to-Many)
The multi-select combo box should store selections in EntityA_EntityB association.
2. Create a Microflow (on Save button)
Step 1 — Retrieve selected companies
Retrieve EntityB through association:
[EntityA_EntityB = $EntityA]
Result → $CompanyList
Step 2 — Create String variable
$CompanyString = ''
Step 3 — Loop
Loop through $CompanyList.
Inside loop update string:
if $CompanyString = '' then $IteratorEntityB/CompanyName else $CompanyString + ', ' + $IteratorEntityB/CompanyName
Step 4 — Update EntityA
Change Object:
$EntityA/Companies = $CompanyString
Commit if needed.
If user selects:
Google Microsoft Apple
Stored value becomes:
Google, Microsoft, Apple
Multi-select widgets → store data in association, not in string attributes.
So the correct approach is retrieve list → loop → build string.