Keyword modifiers within a keyword modifier


(Joy) #1

I have a form where the recipient email uses keyword modifiers to show if a question has been answered or not rather than showing a blank based on a previous question.

E.g.

 

Do you want to book flights: No

 

Date of flight: Not required.

 

 

For the above example, I have used:

 

%response_1_q1^replace_keywords:contains:No:Not required:{response_2_q2}%

 

 

If the user has answered Yes to 'Do you want to book flights?', the 'Date of flight' will appear blank if the user hasn't entered anything in.

 

What is the syntax to show 'Not answered' if the 'Date of flight' is empty but they do want to book flights?

Can I use a keyword modifier within a keyword modifier?

 

Thanks


(Anthony Ponomarenko) #2

yes you can have modifiers, try something like: {response_2_q2^empty:Not Answered}


(Joy) #3

Hi Anthony,

 

I tried the keyword modifier you suggested and it didn't work, the output was the keyword modifier itself i.e.

Date of flight: {response_2_q2^empty:Not Answered}

 

I am using Matrix 5.2.6.1


(Anthony Ponomarenko) #4

did you replace it in your original keyword block as so:

 

%response_1_q1^replace_keywords:contains:No:Not required:{response_2_q2^empty:Not Answered}%


(Joy) #5

Yes replaced it exactly as is.


(Anthony Ponomarenko) #6

So it seems we found a wee bug, if there is a space in the 'empty' modifier string the keyword is printed as a string instead of being evaluated.

 

I will submit a bug report for it but you could just remove the space to get it working in the meantime.

 

eg:

 

%response_1_q1^replace_keywords:contains:No:Not required:{response_2_q2^empty:Unanswered}%


(Anthony Ponomarenko) #7

Heres the bug report if you have access to Squizmap:

 

https://squizmap.squiz.net/matrix/9095 


(Joy) #8

Thanks Anthony.

 

And how do I get access to Squizmap?


(Anthony Ponomarenko) #9

You need to be a client of Squiz and have access to the Extranet. 


(Bart Banda) #10

You can contact your account manager at Squiz so that they can organise that access for you.