Is there a way to load a previous value from a previous event?

Hello, I have a repeatable event and would like to load the previously submitted value into the data element in the current event. Is this possible?

Thanks!

1 Like

Hi @Clara .

What you are describing is achievable via program rules. You will need to create one Program Rule Variable specifying the source type:
image

Then you will need a Program Rule to assign that variable to the data element you want. In case you want this to happen in every case you can force the condition with something like true

Best.

Thanks @jaime.bosque. The problem is that when I assign a value, it can’t be changed later and I want to be able to change the value later. Is this possible?

Sounds like you’re saying that in the program rule you have, it is triggering it to assign a value to something, and as such, that trigger isn’t allowing you to change it later. So you want something like a “default” value.

If so, this is something that I’ve been wanting to try as well. I have noted that when an expression is true and then becomes false, the program rule will “release” the value and allow it to be edited. Then if the expression becomes true again, it will re-assign it.

Given this, I would bet you could do something where you have the original expression “&& d2:hasValue()” on the dataElement. Something like that should assign the value but then immediately make it able to alterable.

Full disclosure: Haven’t tested this!

1 Like