I am trying to assign the same value from an existing event in Tracker capture to a new event. Even thou the value is the same, the data elements are different. For example in event A the data element is City and in Event B the data element is Town. I’ve tried the d2:hasValue(‘City’) expression and assigned #{city} to Town in my action but I seem to be missing something (I was thinking it is that simple).
I don’t quite fully understand what we are trying to achieve with #{City} == ‘City’ if this is to be part of my rule expression
This looks like I already have a value for City? Or please help me understand because if I am to copy your suggestion in the end my expression will be
d2:hasValue(#{City}) == true && #{City} == #{City} and my expression in action remains #{City}. Is that correct?
You’re correct! So the idea would be if DE1 has a value assign that same value to DE2: Expression: d2:hasValue(#{DE1}) == true Action: assign value to #{DE2}
Make sure you clear the cache to be able to see the changes working correctly and not select a trigger only for one program stage because it needs to work across the different stages. You might also need to set a priority, it wasn’t working for me in the Child Program on play until I gave it a priority of 1.
This is my expression rule: d2:hasValue(#{CM2.25}) == true
My priority is set to 3, because I quite have a few number of validation rules in this program.
I am assigning to cm3d.2
And, Expression to evaluate and assign I put: #{CM2.25}
I didn’t select a program stage like you suggested.
cm3d.2 is still empty and I expected it to have “Life” from cm2.25
If you set the priority to 1 does it still not work? The rule is correct … do you see any errors in the Network tab? Did you clear the cache after creating the program rule and testing?
BTW, I’m also testing this and it seems to work differently when the first DE is in the registration form. The value will not be assigned to DE2 if the first DE is in the registration form until you edit DE1’s value again after registering.
It is still not working, I even tried assigning an actual value given that I know the value to the first data element. This error pop up how ever when I set the priority to 1, if I assign an actual value