Page 1 of 1

Conditional text based on variable content?

Posted: Mon Nov 25, 2019 12:25 am
by FeeMaher
I have come across a new problem and am wondering how others deal with it.
I have a variable for 'product name'. If I use the word 'a' before the product name variable e.g. this is a 'product name' requirement, or a 'product name' user is required to x x x.
However, two of the product names I have start with a vowel. So when I build the target, I actually need the word 'an' instead of 'a'. The product name variable isn't always preceded with an 'a', so I can't add the 'an' or 'a' to the variable content without causing a problem.

Any ideas?

Thanks in advance!

Re: Conditional text based on variable content?

Posted: Mon Nov 25, 2019 10:07 am
by ChoccieMuffin
Think you're going to need two variables - "a [product_name]" and "[product_name]" - and use whichever one is appropriate in the circumstance. Probably not ideal, but better than nothing.

Re: Conditional text based on variable content?

Posted: Mon Nov 25, 2019 2:23 pm
by doloremipsum
I have the same very frustrating problem - our products and companies vary between vowels and consonants. I use snippets with condition on the [n] so it will only appear in some outputs (easier than creating new variables for me). Note that you will need two - one for small a(n) and one for capital A(n)!

Re: Conditional text based on variable content?

Posted: Mon Nov 25, 2019 3:20 pm
by FeeMaher
Ah yes good point on the capitalisation! Thanks for your feedback :)