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

[Feature Request]: conditioned output as a variable not just a message(string) #70

Closed
seddik11 opened this issue Feb 20, 2020 · 3 comments

Comments

@seddik11
Copy link

Hello, i want to test if a variable is null before getting one of its properties..i tried to do this {d.val:isEmpty("value is null"): d.val.id} but didn't work [Error: Formatter "d.val.id" does not exist. Do you mean "div"?] how can i manage to do this and if it is not possible we would like to see this feature in the future release..

@willemevenwel
Copy link

Did you get a response? I would also like to know this.

@steevepay
Copy link
Member

Hello @seddik11, thank you for writing to us!
Unfortunately it is not possible to check if a variable is defined to print it. For now, you can only insert static string into arguments as explained in the documentation.
{d.myvariable:ifEqual(2, “two"):print(“unknown”)}.
This is closely related to the feature request pass variables into formatters arguments and conditional sections.

@steevepay
Copy link
Member

Now you can pass variables into formatters, check out the update: #65 (comment)

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

3 participants