Is it possible to have multiple triggers?

Hi all, is it possible to have multiple triggers in the “trigger” column when designing the XLSX? The XLSXForm doc (XLSForm Docs) does not mention this.

I have 2 fields: foto1 and foto2, and would like to have another calculate field that concatenates names from foto1 and foto2: concat(${foto1},'-',${foto2}). I would like to recalculate the field “foto” each time either “foto1” or “foto2” are changed.

Can I simply add ${foto1}, ${foto2} to a trigger column?

2 Likes

Could you kindly share us a dummy xlsform of what you intend to do?

Please find attached a sample xlsform. sample_multi_triggers.xlsx (10.2 KB)

image

Let’s say I’d like to update (recalculate) uuid() each time field1 or field2 are modified.

Hi @janekb
Could you try the following approach and indicate if it worked for you.

image

Stephane

1 Like

Thanks @stephanealoo for your suggestions. I’ve tried - it does not work for me, i.e. uuid() is not recalculated when either field1 or field2 are modified. However, the sample xlsform I’ve shared earlier (just ${field1} as a trigger) is not working either, i.e. uuid() is not recalculated. Neither in Enketo nor in Collect.
But maybe I’m missing something? I’d like to update (recalculate) uuid() each time field1 or field2 are modified. Should I use a group so that uuid field is in a separate group then field1 and field2?

Hi @janekb,

Kindly please be informed that currently trigger is not supported in KoBoToolbox but the same will be available soon. Will let you know when it’s available.

2 Likes

Thanks @Kal_Lam for the update!

1 Like

Hi @Kal_Lam ,
Unless I’m mistaken, trigger is currently supported in KoBoToolbox.
Hi have the same question than @janekb ,
Is it (now) possible to have multiple triggers for the same question ?

Thank you

@jdugh, please be informed that trigger is now supported with KoBoToolbox. You should be able to learn more through this workaround shared previously:

Thank you @Kal_Lam ,

There must be an explanation error, sorry.
I talk about the trigger column (not trigger question type).

Like this one :
image

I have test this solution (i.e. ${field1} or ${field2}) without success.
Do you know if there is any solution for make this ?

Thank you

Well if that’s not possible you could do it as outlined in the image shared below:

In the survey tab of your XLSForm:

Image 1

Data entry screen as seen in Enketo: when nothing is entered

Data entry screen as seen in Enketo: when something is entered in the first variable

Data entry screen as seen in Enketo: when something is entered in the second variable

Reference XLSForm:

sample_multi_triggers.xlsx (10.4 KB)

1 Like

Nice, Thank you @Kal_Lam !

1 Like