Skip to main content
Solved

Evaluate Boolean True or False using tester

  • February 6, 2019
  • 5 replies
  • 284 views

miquelrs
Contributor
Forum|alt.badge.img+7

Here's a basic one. Have a Boolean field and need to evaluate if it is T or F using a Tester transformer.

Have tried using "Field = F", "Field = False", "Field = 0" in the tester, but none of them seem to work.

This should be straightforward but I can't find it anywhere in the documentation.

 

Thanks in advance,

Best answer by david_r

It will depend on the input format. In my experience boolean fields are often represented as lower-case "true" or "false", but it can vary.

If you're completely stuck, consider connecting an Inspector on the reader (or create a breakpoint) and look at the data.

View original
Did this help you find an answer to your question?

5 replies

david_r
Celebrity
  • Best Answer
  • February 6, 2019

It will depend on the input format. In my experience boolean fields are often represented as lower-case "true" or "false", but it can vary.

If you're completely stuck, consider connecting an Inspector on the reader (or create a breakpoint) and look at the data.


miquelrs
Contributor
Forum|alt.badge.img+7
  • Author
  • Contributor
  • February 6, 2019
david_r wrote:

It will depend on the input format. In my experience boolean fields are often represented as lower-case "true" or "false", but it can vary.

If you're completely stuck, consider connecting an Inspector on the reader (or create a breakpoint) and look at the data.

Thanks david_r, I have already inspected the field and seems to be string "false", but using "false" in the tester doesn't work.


david_r
Celebrity
  • February 6, 2019
miquelrs wrote:

Thanks david_r, I have already inspected the field and seems to be string "false", but using "false" in the tester doesn't work.

Can you post a screenshot of your Tester configuration?


miquelrs
Contributor
Forum|alt.badge.img+7
  • Author
  • Contributor
  • February 6, 2019
david_r wrote:

It will depend on the input format. In my experience boolean fields are often represented as lower-case "true" or "false", but it can vary.

If you're completely stuck, consider connecting an Inspector on the reader (or create a breakpoint) and look at the data.

It worked now using Filed = false. I needed to delete the output before running the script, otherwise it was just adding rows at the end of the existing file.

Thank you very much!


david_r
Celebrity
  • February 6, 2019
miquelrs wrote:

It worked now using Filed = false. I needed to delete the output before running the script, otherwise it was just adding rows at the end of the existing file.

Thank you very much!

Excellent!


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings