I am using the JSON parsing tool with the goal of writing the response to a sql server table. It is getting parsed correctly, but it is only pulling the first object. The response will be multiple objects every time, so i would like to have a new row for each. I am able to do this in Power BI just find with the parse/convert to table.
Any ideas?
Sample return: (Rows would be for each ID)
"id_0":{"date_time":"2020-03-04 14:19:41","hostname":"test","server_name":"test","server_ip":"tes","unique_id":"1234","call_type":"t","source_num":"t","source_name":"","to":"t","dest_num":"t","dest_name":"","trunk_name":"t","duration":"t"},
"id_1":{"date_time":"2020-03-04 14:19:41","hostname":"test","server_name":"test","server_ip":"test","unique_id":"test","call_type":"t","source_num":"t","source_name":"","to":"t","dest_num":"t","dest_name":"t","trunk_name":"t","duration":"t"}
Solved! Go to Solution.
Hi @thampton ,
Have you managed to insert the row to SQL Server?
As @ChristianAbata asked, could you please share a screenshot of the configuration of your flow?
You could take a try with the schema below:
{
"type": "object",
"properties": {
"date_time": {
"type": "string"
},
"hostname": {
"type": "string"
},
"server_name": {
"type": "string"
},
"server_ip": {
"type": "string"
},
"unique_id": {
"type": "string"
},
"call_type": {
"type": "string"
},
"source_num": {
"type": "string"
},
"source_name": {
"type": "string"
},
"to": {
"type": "string"
},
"dest_num": {
"type": "string"
},
"dest_name": {
"type": "string"
},
"trunk_name": {
"type": "string"
},
"duration": {
"type": "string"
}
}
}
Best regards,
Alice
Community Support Team _ Alice Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
hi @thampton you can try this.
Proud to be a Flownaut!
@ChristianAbata Thank you ! Weird thing, when i go to select an output from previous steps, i get no dynamic content. However, at the end of my flow when i am inserting into SQL, the fields are available.
@thampton cloud you show us an screanshot?
Proud to be a Flownaut!
Hi @thampton ,
Have you managed to insert the row to SQL Server?
As @ChristianAbata asked, could you please share a screenshot of the configuration of your flow?
You could take a try with the schema below:
{
"type": "object",
"properties": {
"date_time": {
"type": "string"
},
"hostname": {
"type": "string"
},
"server_name": {
"type": "string"
},
"server_ip": {
"type": "string"
},
"unique_id": {
"type": "string"
},
"call_type": {
"type": "string"
},
"source_num": {
"type": "string"
},
"source_name": {
"type": "string"
},
"to": {
"type": "string"
},
"dest_num": {
"type": "string"
},
"dest_name": {
"type": "string"
},
"trunk_name": {
"type": "string"
},
"duration": {
"type": "string"
}
}
}
Best regards,
Alice
Community Support Team _ Alice Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@v-alzhan-msft No i wasnt able to get this working, yet. It seems there is something wrong with my json response. If you use a json parser onlne, it is valid, but no dynamic content is shown. This is exactly how it is when i select show output. I need to be able to insert a row for each Id, but right now, if i want to loop through with apply to each, my only dynamic content is "Body".
{"body":{"id_0":{"date_time":"2020-03-13 08:44:16","hostname":"test","server_name":"test","server_ip":"test.test","unique_id":"1234567","call_type":"testcall","source_num":"0","source_name":"","to":"0","dest_num":"0","dest_name":"Test","trunk_name":"0","duration":"115"}}}
Let me know if you can help, thanks in advance!
Hi @thampton ,
Could you please share a screenshot of the configuration of your flow?
Best regards,
Alice
Community Support Team _ Alice Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@v-alzhan-msft It looks like the config you had posted above. The only issue is the dynamic fields to not show up when you place an apply to each under the parse, so im not able to create a new row in SQL for each ID.
Hi @thampton ,
So I need the full screenshot of the configuration of your flow to reproduce your issue and help you.
I also need the full text you enter in the content field of the Parse JSON action.
Best regards,
Alice
Community Support Team _ Alice Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@v-alzhan-msft Below is the screenshot of my config. The API returns the text below. The schema is also below.
Config:
{"body":{"id_0":{"date_time":"2020-03-13 08:44:16","hostname":"test","server_name":"test","server_ip":"test.test","unique_id":"1234567","call_type":"testcall","source_num":"0","source_name":"","to":"0","dest_num":"0","dest_name":"Test","trunk_name":"0","duration":"115"}}}
Schema:
@v-alzhan-msft It wont let me attach screenshot, but config is below:
1. Frequency : 1 hour
2. Customer connector : Calls API and returns the body above.
3. Parse : using the schema above
Hi @thampton ,
Input in the Compose:
{"body":{"id_0":{"date_time":"2020-03-13 08:44:16","hostname":"test","server_name":"test","server_ip":"test.test","unique_id":"1234567","call_type":"testcall","source_num":"0","source_name":"","to":"0","dest_num":"0","dest_name":"Test","trunk_name":"0","duration":"115"}}}
Expression in the Compose 2:
outputs('Compose')?['Body']?['id_0']
Schema:
{
"type": "object",
"properties": {
"date_time": {
"type": "string"
},
"hostname": {
"type": "string"
},
"server_name": {
"type": "string"
},
"server_ip": {
"type": "string"
},
"unique_id": {
"type": "string"
},
"call_type": {
"type": "string"
},
"source_num": {
"type": "string"
},
"source_name": {
"type": "string"
},
"to": {
"type": "string"
},
"dest_num": {
"type": "string"
},
"dest_name": {
"type": "string"
},
"trunk_name": {
"type": "string"
},
"duration": {
"type": "string"
}
}
}
The flow:
Best Regards,
Alice
Community Support Team _ Alice Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
User | Count |
---|---|
92 | |
45 | |
21 | |
18 | |
16 |
User | Count |
---|---|
136 | |
49 | |
42 | |
36 | |
28 |