Question

Using the JSON Object Manager Query Action to pull a Boolean value from a JSON string

  • 18 March 2022
  • 1 reply
  • 138 views

I am trying to use the JSON Object Manager to pull a value from a JSON string.

The value I am trying to pull is a true boolean value within the string.

The problem seems to be that the Query action only outputs to a String variable or an Any variable. I cannot choose a Boolean variable to hold my output value.

 

The relevant portion of the JSON string looks like this:

{"response": {"pages": {"hasMore": true,"nextPage": "1"}}}

 

My Query action looks like this:

response.pages.hasMore

 

Whether I use an Any variable or a String variable to hold the output value, the output value is blank when displayed in a message box.

 

I have tried creating an If action with a boolean condition and that does not interpret the output (which should be true) correctly. I have tried converting it from boolean to string, but that throws an error telling me it is expecting boolean input and received a string input.

 

I have tried converting from string to boolean and then back to string but that still yields a variable with no value.

 

I need to output this boolean value and cannot figure out how to do it.


1 reply

Userlevel 3
Badge +6

@Michael Smith​ Use this package: https://botstore.automationanywhere.com/bot/json-reader/p>

This will return correct Boolean value in string.

Reply