New Mendix Action: Create or Update Object - Mendix Forum

New Mendix Action: Create or Update Object

0

New Mendix Action: Create or Update Object

Idea

A reusable action that combines Mendix's Create Object and Change Object functionality into one configurable action.

The goal is to reduce repetitive Microflow development, avoid duplicated logic, and make object handling easier to maintain.

Currently, I often need separate Create Object and Change Object activities, even when most of the attribute logic is identical. This action would combine both operations and allow developers to configure what happens depending on whether the object is new or already exists.

1. Automatic Create or Update detection

Pass an object into the action.

The action automatically determines what operation to perform:

No separate decision or duplicated Microflow logic should be necessary.

2. Attribute configuration

For each attribute, provide two independent configuration options:

This allows developers to decide which attributes should be populated or changed during each operation.

Example:

Attribute

On Create

On Update

Name

✓

✓

Description

✓

Building ID

✓

Created Date

✓

Modified Date

✓

Energy Class

✓

✓

Attributes can therefore have:

3. Duplicate attribute configuration

An optional but useful feature would be the ability to duplicate an attribute configuration row.

This would be particularly helpful when the same attribute needs different conditional logic for Create and Update.

For example, a developer could duplicate an attribute and configure one row for creation and another for updating, without having to recreate the entire configuration.

This could also simplify more complex conditional expressions where the logic is almost identical but has a few differences.

4. What happens after Create or Update?

The action should allow developers to configure what happens with the object after each operation.

For example:

The two configurations could point to the same list or to different lists.

5. Return operation result

The action should return an operation result indicating what happened.

Preferably an enumeration rather than just a Boolean:

Or just set a value to a Boolean-varible

This allows developers to use a subsequent decision in the Microflow to execute different logic depending on the operation.

6. Potential extensions

The concept could potentially support additional functionality in the future:

Benefits

The main idea

Instead of building separate Create and Update logic in every Microflow, developers should be able to configure one reusable action that automatically handles both operations.

Configure what should happen, rather than manually building how it should hoppen.

I'd be interested to hear whether other Mendix developers see value in this concept and whether they think it would be best implemented as a custom action, a widget, or a combination of both.

asked
0 answers