How to extract specific node in JSON Databank
Hi Team,
I have a requirement where i have to get the specific node in json object.
from the below example, How do i fetch the "Node_12345", any help would be appreciatable.
"Node_12345": {
"Key": "XXXXX",
"value": "YYYYY"
},
I have use xpath : root\node() --> this gives me complete xml. But i need to fetch this node alone.
Comments
-
Hey Uday,
Do you want to capture the name of the node or the entire element? Try the following:
Xpath: /root
result: {"Node_12345":{"Key":"XXXXX","value":"YYYYY"}}Xpath: /root/Node_12345[1]/name()
result: Node_123451 -
Hi Omar,
Problem here is i dont have the node value.
without the node values, is it possible to get all the nodes present in that loop..
configs{
"Node_1": {
"Key": "XXXXX",
"value": "YYYYY"
},
"Node_2": {
"Key": "XXXXX",
"value": "YYYYY"
},
"Node_3": {
"Key": "XXXXX",
"value": "YYYYY"
},
"Node_4": {
"Key": "XXXXX",
"value": "YYYYY"
}
}expected result is like
Node_1
Node_2
Node_3
Node_40 -
Do they all have a partially similar name?
If so, You may be able to use the "contains" function to retrieve all the node names that contain the shared word in their name.0 -
They have all different names..
Basically it supposed to be retrieved database, there are 1000 number of response like that and we wanted to make only one call... When we make one call its difficult to use the writable data source
0 -
Currently we can ignore of this question, I found another solution to loop thru the values.
Passed the DB call output to writable data source and used regular xpath expression to retrieve the values.Thanks
Udaya0