You could implement this by creating a mapping entity defining the attributes that need to be set in a specific order.
Loop over the attribute names and use the index of this loop to assign the appropriate value.
Assigning values dynamically will need to take place in a java action as this way of dynamically setting values is not supported from the default microflow activities.
See https://apidocs.mendix.com/7/runtime/com/mendix/systemwideinterfaces/core/IMendixObjectMember.html