Data value from previous Data element event

I have a program with a single repeatable stage

I have a data element (option set ) that contains an option set (type medication ).

the rule working be successfully , but if i have multi stage and some dataelement in last stage dont have value the system take the values from other stage previous ,

how to do the rule to


take the value only from previous event even if it was empty

1 Like

Hi @ahmad.sbeih

It would help if you share the expression and program rule configuration.

If you want the value to be only from the previous data element then make sure that the program rule variable source type is 'data element from previous event

In the program rule expression, you will need to check if it has a value, if it doesn’t have a value then you will assign it an empty value ''

I hope this works. Please post back with an update, and if it doesn’t work please share the whole configuration and expression.

Thank you!

thanks @Gassim
i create rule variable source type is 'data element from previous event
the system assgin value , but the problem when if the program have two event for the same stage and last event dont have value the system assgin value from other stage have value
i tried to create programe rule to assgin empty or 0 if the dataelement not have value , the reuslt same problem

Hi @ahmad.sbeih

Thanks for the info. I believe you and @emad are facing a similar issue (Assign value from previous variable - #6 by Gassim). I’ll try to reproduce this one play as well and triage this to @tracker-programRules :pray:

I’ll keep you posted asap.