Detect a change to intent data

I use an intent sent from macrodroid (using the tasker plugin) which is just a number string.
I use the broadcast receive function $br() to capture the number to a string.

The number is stored in a global variable. There are actually three numbers really in CSV format but to keep things simple I’ll talk about just one.

This number is displayed on the screen. As you can imagine every time a new intent is received this displayed number is updated.

I can also tap two KWGT shapes (next to the displayed number) who’s job it is to increment or decrement the displayed number.

When the shapes are touched they alter another global variable which is added on to the above number from the intent, and so there are two sources from which the displayed number can be altered.

I want the intent data to take priority so that a new number is displayed as soon as it is received. The trouble is, I can’t make a comparison to the old intent number as any attempt to look at a variable containing the old intent number is updated automatically with the new intent data.

Is there an automatic way to detect when data from an intent is no longer the same as the data from the last intent? It has to be automatic.