I am trying to creating a macro to calculate moving average based on the group of a field. Work is like the following and attached.

The macro itself works. But in a test workflow, I just changed the field names and the workflow gives a error: Error: Moving Average (5): Tool #2: The field ""Level"" is not contained in the record. I used in action tool Update Value in action type to replace a specific string "Company" in the macro text input. My understanding is that the updated field name from the test workflow is not in the macro input data. Is this right? Can anyone help how to set up the action tool for the field name update?
| Level | Amount |
| A | 1 |
| A | 2 |
| A | 3 |
| A | 4 |
| B | 5 |
| B | 6 |
| B | 7 |
| B | 8 |
Thanks