Dear community, @Gassim is there a way that I can write a program rule so that the name value would appear on other data elements? I am not sure the question is well structured but I can give an example here:
name: Pacifique
Pacifique phone number: +250899988
Pacifique Gender: Male
as you can see here data elements are : name, Phone number and Gender, but after typing name, it’s value continues to appear on other DE,
Hi @Pacifique_Hategekima,
I understand that it’s possible to create a program rule that uses the function d2:concatinate(<object>,<object>,...) to assign the value to a Data Element, Tracked Entity Attribute (TEA), or Program Indicator. Does it specifically need to display like this, @Pacifique_Hategekima? How about making the values appear in the feedback widget then it’ll be much easier I guess.
I tried right now to create PR-variables for the TEAs and then the expression is d2:hasValue{A{FirstName}} && d2:hasValue{A{LastName}} then the program rule action would be assign to the TEA First Name:
d2:concatenate(A{Child-First-Name}, ’ ', A{Child-Last-Name})
And the same for the TEA Last Name. This was the idea but I wasn’t able to get it to work. Note, I only tried this on TEA and not DEs.
gender: user enters gender and triggers PR to concatenate (first and last name) ↓ so that after the rule triggers:
first name: first + last
last name: first + last
However, this too is wrong because we are changing the data values for each data element! I think another option is create one data element that will display all the concatenations:
data element shows every value entered: first + last + gender + phone number …etc
Thanks, @Gassim I get you, actually I see that the problem is that data is stored in data element therefore changing it means different data element.
my preference would be to display whatever I want to display in a widget, the problem is that widget are not well visible in mobile app unless there is other way that widgets can be put on front page in mobile app.
So the purpose is to display the info to the user when they enter the info using the android Capture app? Would a Display Text action in a program rule make up for it? It will be visible on the screen. (:
Sorry @Pacifique_Hategekima when I tried it and it wasn’t working and then I went back to the docs. In a tracker program, it will display in form only for one case which is when the Pogram Rule is configured as “Trigger rule only for program stage.”
@Gassim is sharing the correct information. If you want to use the widgets to display text or values (using program rules), those elements will be displayed in the Analytics tab and not in the form.
So I would suggest to use one or more data elements to assign the information.