I have a json output from a http service coming like this. "mes

I have a json output from a http service coming like this.

"message":{
"validation_errors":"True",
"error_data":{
"push_qa_contact_phone":[
"Missing data"
],
"push_dev_contact":[
"Missing data"
],
"component":[
"The Component in your JIRA Ticket is not eligible for OpenWindow."
],
"push_dev_contact_phone":[
"Missing data"
],
"push_qa_contact":[
"Missing data"
]
}
},

I would like to get all the keys under error_data, the keys could keep changing in output how do I get all the keys in this output and parse through each one of them?

OriginalPostID-147661

OriginalPostID-147661

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Lead Developer
    No you will need to know the keys to be able to query the data. The function a!fromJson() will put the data into a dictionary syntax which will make it easier to parse. I also asked if there is a finite list of possible error keys? If so you could create a constant to hold that full array (i.e. push_qa_contact_phone, push_dev_contact etc) and then on each response you could loop over the returned values and use the index() or property() functions to retrieve the values per key
Reply
  • 0
    Certified Lead Developer
    No you will need to know the keys to be able to query the data. The function a!fromJson() will put the data into a dictionary syntax which will make it easier to parse. I also asked if there is a finite list of possible error keys? If so you could create a constant to hold that full array (i.e. push_qa_contact_phone, push_dev_contact etc) and then on each response you could loop over the returned values and use the index() or property() functions to retrieve the values per key
Children
No Data