We have custom field with decimal values in it. We want to calculate the sum(custom fields) from 2022 to 2026 and repeat this calculation everyday.
We have created another field to store this sum value.
How could we use the workflow to calculate sum for custom field?
For example, FIELD1 has values in multiple records like 2.5, 9.99, 2.01.
FIELD2 should store sum( 2.5, 9.99, 2.01)
Hello,
that looks like a architectural issue.
Technically, you’re storing a string inside a field.
If you want to keep it like this, you’d now need to use PHP with a logic hook / scheduler and parse your string:
Whilst you’re working on your custom scheduler code anyway, you can simply write the sum into your result field:
The cleaner approach would be to either use one individual field per operand (Field 1: 2.5, Field 2: 9.99, …).
Or, if your data structure is somewhat chronological, create a real 1:n relationship with a custom module.
(However, if it’s only one value per year, adding one field per year might work well enough).
1 Like
I was able to do it with the scheduler.
Thank you so much for your help.