Currently, I am attempting to write a conditional statement that states the following
If($JSON.response = false){
'Dont do anything and continue to the next block of code.'
}
Right now the JSON returns like this when there is no data:
response_code response
------------- --------
0 {}
This is what I have so far:
If($json.response = 0){
'Dont do anything here'
}elseif($json.response = 1){
'Do the code'
}
I'd like to add that response_code is always equal to 0 when the response is error free as in status code 200. However, when there are no fields returned response is just an empty hashtable.
$in front of false and also use-eqfor comparisons like so:If(JSON.response -eq $false){json.responserather thanjson.response_code? The numeric comparison suggests that you should be testingjson.response_code.