Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replacing Expressions in a .docx Template but outputting Variable Value #88

Open
codewithpav opened this issue Dec 9, 2020 · 2 comments

Comments

@codewithpav
Copy link

Hi there

Apologies if this has been dealt with already but I know that it's possible to do:

${person.name.equals("Homer") ? "Duff" : "Budweiser"}

But I'm struggling to get this to work so that a value from another variable is displayed instead.

${person.surname.equals("Homer") ? ${person.favourite_drink} : "Duff"}

Any help would be appreciated.

Thanks

Pav

@thombergs
Copy link
Owner

Try this:

${person.surname.equals("Homer") ? person.favourite_drink : "Duff"}

@codewithpav
Copy link
Author

This is perfect. Thank you for your quick response.

Thanks again.

Pav

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants