marting Neophyte
Neophyte
3 years agoJSON Path capability in a Webpage DataSource
 I think the answer to this is gonna be “You need to script it, dummy”, but figured I’d check anyway...  I'm working on a new DataSource that pulls/interprets JSON data from a peudo-custom system via ...
- Anonymous3 years agoThere’s an easier way than this: function parseBooleanValue(value) {
 if (value === 'true') {
 return 1;
 } else if (value === 'false') {
 return 0;
 } else {
 return null; // or throw an error, depending on how you want to handle invalid values
 }
 }It uses the ternary operator: (value == "true") ? 1 : 0This is exactly equivalent to: if (value == "true") {
 return 1
 } else {
 return 0
 }No need for a function at all, it’s overkill. 
