Using a microflow to change a button caption

Hi everyone, I have a simple page containing a Data View with the standard Save, Cancel & Delete buttons. I recently figured out how to replace the Save button with a button that triggers a microflow which both saves and displays a message to the user, but that then got me wondering whether it was possible to use a microflow to change the caption (i.e. text) shown on a button elsewhere on the page, and by extension other properties of an object. It may not be possible, and I’ve not found any obvious way of doing this myself, but I am very new to the Mendix platform so if anyone can answer this or point me in the right direction I’d be grateful!   I’d also be interested to know if the same effect could be achieved with a different / non-microflow based approach
1 answers

Hi John,

There is an edit button on the caption field.  In this edit menu you can define parameters that can be inserted into the caption field.

In this case I created an example with a boolean parameter on a document so the button will either read “Scanned: True” of “Scanned: False”

If you wanted a completely custom caption field you can just set the caption to the value of a parameter string.  Then you can change that string in a microflow (or nanoflow) and the button caption will be updated.  This approach does come with a bit of maintenance as you always have to make sure that the caption field is set to the value that you want your user to see (such as making sure it is populated when the page is opened etc.).

As Vincent suggested, if you just have two caption options it can often be easier to maintain if you just create two buttons with different captions on your page and then set their conditional visibility property to opposite values of a boolean attribute.  Then when that boolean gets changed, either by a user or in a microflow, one button will hide and the other will show.  Which to the end user appears as the button changing its caption even though it is two different buttons.

Hope this helps,