Get a specific value within a bundle with multiple values

Hello Make Community!

Hoping you can help with this one.

I would like to get the (1449226.07) value field from the following output:

“ReportDate”: “13 August 2024”,
“UpdatedDateUTC”: “2024-08-13T14:41:36.931Z”,
“Fields”: ,
“Rows”: [
{
“RowType”: “Header”,
“Cells”: [
{
“Value”: “Date”
},
{
“Value”: “Description”
},
{
“Value”: “Reference”
},
{
“Value”: “Reconciled”
},
{
“Value”: “Source”
},
{
“Value”: “Amount USD”
},
{
“Value”: “Balance USD”
}
]
},
{
“RowType”: “Section”,
“Title”: “”,
“Rows”: [
{
“RowType”: “Row”,
“Cells”: [
{
“Value”: “2024-08-13T00:00:00”
},
{
“Value”: “Opening Balance”
},
{
“Value”: “”
},
{
“Value”: “”
},
{
“Value”: “”
},
{
“Value”: “”
},
{
“Value”: “1449226.07”
}
]
},
{
“RowType”: “Row”,
“Cells”: [
{
“Value”: “”
},
{
“Value”: “Closing Balance”
},
{
“Value”: “”
},
{
“Value”: “”
},
{
“Value”: “”
},
{
“Value”: “”
},
{
“Value”: “1449226.07”
}
]
}
]
}
],
IMTLENGTH”: 1,
IMTINDEX”: 1
}
]

But I do not know how to map to that specific value with all the multiple value outputs I’m getting.

I’ve tried text aggregator, JSON parser, Iterator and Array aggregator. But nothing seems to be working.

Bundle 1:
+Rows
+2
+Rows
+Cells
+2 (Closing Balance)
+7 (1449226.07)

Also I am worried that the value may not always be in the exact same place. Would be even better if I can always have it map to the closing balance value.

Does anyone have any suggestions please?

From the way it is structured I am guessing that the JSON is being pulled out from a table correct? In that case the positions should remain constant as long as they are not restructuring the table. You need to use the map() function to drill into the values you want.

The JSON provided is invalid. If you can provide me with a valid JSON I may be able to show you how to use the map() function.

1 Like

For further assistance, please provide the following:

Please provide the output bundles of the modules by running the scenario (or get from the scenario History tab), then click the white speech bubble on the top-right of each module and select “Download input/output bundles”.

A.

Save each bundle contents in your text editor as a bundle.txt file, and upload it here into this discussion thread.

B.

If you are unable to upload files on this forum, alternatively you can paste the formatted bundles in this manner:

Here are two ways to format text so that it won’t be changed by the forum:

A. Type code block manually
Add three backticks ``` before and after the content/bundle, like this:

```
content goes here
```

B. Highlight and click the format button in the editor

Providing the input/output bundles will allow others to replicate what is going on in the scenario even if they do not use the external service.

Following these steps will allow others to assist you here. Thanks!

Managed to figure it out using a text aggregator. One needs to map the row/ cell numbers:

image

3 Likes