LineItems Extractions from JSON

I want to extract line items from a json but facing issues. I want Description and HSN to be extracted.

[
{
“docType”: “custom:d7c1f87e-815b-4054-a442-c5b519108eb2”,
“modelId”: “d7c1f87e-815b-4054-a442-c5b519108eb2”,
“pageRange”: [
1,
3
],
“fields”: {
“Vendor Address”: {
“type”: “string”,
“valueString”: “INDUSTRIAL AREA DELHI ( PH.NO- 011-40111836)”,
“text”: “INDUSTRIAL AREA DELHI ( PH.NO- 011-40111836)”,
“page”: 1,
“boundingBox”: [
0.545,
0.62,
3.13,
0.62,
3.13,
0.895,
0.545,
0.895
],
“confidence”: 0.294,
“elements”: [
“#/readResults/0/lines/5/words/0”,
“#/readResults/0/lines/5/words/1”,
“#/readResults/0/lines/5/words/2”,
“#/readResults/0/lines/5/words/3”,
“#/readResults/0/lines/5/words/4”,
“#/readResults/0/lines/8/words/0”,
“#/readResults/0/lines/8/words/1”,
“#/readResults/0/lines/8/words/2”,
“#/readResults/0/lines/8/words/3”
]
},
“Invoice Date”: {
“type”: “string”,
“valueString”: “29-Jul-2021”,
“text”: “29-Jul-2021”,
“page”: 1,
“boundingBox”: [
6.34,
0.68,
7.08,
0.68,
7.08,
0.81,
6.34,
0.81
],
“confidence”: 0.995,
“elements”: [
“#/readResults/0/lines/7/words/0”
]
},
“Invoice Number”: {
“type”: “string”,
“valueString”: “792/21-22”,
“text”: “792/21-22”,
“page”: 1,
“boundingBox”: [
4.78,
0.655,
5.4,
0.655,
5.4,
0.785,
4.78,
0.785
],
“confidence”: 0.994,
“elements”: [
“#/readResults/0/lines/6/words/0”
]
},
“Vendor Name”: {
“type”: “string”,
“valueString”: “ENTERPRISES”,
“text”: “ENTERPRISES”,
“page”: 1,
“boundingBox”: [
0.545,
0.485,
1.765,
0.485,
1.765,
0.615,
0.545,
0.615
],
“confidence”: 0.992,
“elements”: [
“#/readResults/0/lines/2/words/0”,
“#/readResults/0/lines/2/words/1”,
“#/readResults/0/lines/2/words/2”
]
},
“LineItems”: {
“type”: “array”,
“valueArray”: [
{
“type”: “object”,
“valueObject”: {
“Description”: {
“type”: “string”,
“valueString”: “Letter Head A4”,
“text”: “Letter Head A4”,
“page”: 1,
“boundingBox”: [
0.685,
4.21,
1.635,
4.21,
1.635,
4.325,
0.685,
4.325
],
“elements”: [
“#/readResults/0/lines/49/words/0”,
“#/readResults/0/lines/49/words/1”,
“#/readResults/0/lines/49/words/2”
]
},
“HSN”: {
“type”: “string”,
“valueString”: “4820”,
“text”: “4820”,
“page”: 1,
“boundingBox”: [
4.725,
4.245,
4.985,
4.245,
4.985,
4.35,
4.725,
4.35
],
“elements”: [
“#/readResults/0/lines/50/words/0”
]
}
}
},
{
“type”: “object”,
“valueObject”: {
“Description”: {
“type”: “string”,
“valueString”: “Letter Head A5 B/S”,
“text”: “Letter Head A5 B/S”,
“page”: 1,
“boundingBox”: [
0.68,
4.345,
1.89,
4.345,
1.89,
4.47,
0.68,
4.47
],
“elements”: [
“#/readResults/0/lines/54/words/0”,
“#/readResults/0/lines/54/words/1”,
“#/readResults/0/lines/54/words/2”,
“#/readResults/0/lines/54/words/3”
]
},
“HSN”: {
“type”: “string”,
“valueString”: “4820”,
“text”: “4820”,
“page”: 1,
“boundingBox”: [
4.73,
4.38,
4.99,
4.38,
4.99,
4.485,
4.73,
4.485
],
“elements”: [
“#/readResults/0/lines/55/words/0”
]
}
}
}
]
}
},
“docTypeConfidence”: 0.659
}
]

Hello Asfaque,
In this video I have an example very similar to your case check from minute 7:

Thanks,
Cristian

1 Like

@Asfaque
Welcome to the forum

Flow

Log:
grafik

item = myJArray(0)("fields")("LineItems")("valueArray").Values(Of JoBject)
item("valueObject")("Description")("valueString").Value(Of String)
item("valueObject")("HSN")("valueString").Value(Of String)

Find starter help here:
ppr_JSONBox_Asfaque.xaml (7.0 KB)

1 Like

Hi @Asfaque ,

Find the workflow it may help you.

jsonextracter.xaml (6.4 KB)

1 Like

Thanks to all.

Issue resolved

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.