Profile update page - only update fields that have changed on 'save' button?

I have a profile page with 9 fields (typical ones such as name, dob, email etc etc.)

There is a ‘Save changes’ button on the page. I have a condition on the button for it to be disabled if no values have been changed (compares each input’s value to the corresponding thing’s field).

When the user hits save I only want to update the fields that have been changed. To do this I have a workflow with 9x ‘Make changes to a thing’ (1 per field) and an 'only when input value =/= thing value…

Does running 9x ‘Make changes to a thing’ have any performance issues? Is there a better way to be implementing this type of functionality?

I’m aware ‘auto-binding’ can make changes as each field is updated, however, this is not the functionality I want.

Yep… aside from being slower, it will cost precisely 9 times more in WUs (at least for the modify a database item actions), when all 9 fields are updated.

Not only that, but it’s hard to setup and maintain - and completely unnecessary.

Is there a better way to be implementing this type of functionality?

Yes… just use a single ‘Make changes to thing’ action to update all fields at the same time - just make sure to set the default/initial values of the input elements to the correct data from the database so nothing gets changed unnecessarily.

2 Likes

Ok thanks, that makes sense. My issue was from an auditing/logging perspective I could make numerous updates without changing a field (say first name), but my logs would show a field was changed 9 times… Guess I’lll just have to go with that.

Would be great if we could have embedded conditions in the make changes to a thing workflow, i.e. for each field.

Quick question…

If the 9 workflows have conditions that mean only 2 execute, does this still count as 9 WUs or 2?

only the workflow actions that run will cost WUs for modifying a thing…

But if the conditions on them a searching the database or retrieving data some other way then they will probably still incur WU costs even if they don’t run.

But it’s easy to test this kind of thing - just run the workflow and check your logs - you’ll see what actions have incurred WU costs.

2 Likes