JSON: Filter bundle if a specific value is present in the array

Hello ,

The goal is:

  1. to create new target JSON from a source JSON.
  2. condition is only that only the bundle must be contained, which should be present in the array states, state with the value “DELIVERED”.
  3. target JSON should only contain the fields salesOrderId and salesOrderPositionItemId.

What is the best way to implement this?
Directly in the variable does not work with map() to implement the condition from point 2.
Example.json (22.4 KB)

Many thanks in advance!

Welcome to the Make community!

1.

Please provide the output bundles of the “GET Return Shipments” module by running the scenario, then click the white speech bubble on the top-right of each module, save the contents as a text file .json, and upload it here into this discussion thread:
Screenshot_2023-10-06_141025

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

2.

Please also provide a sample of the output JSON you want to achieve.

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

2 Likes

Hello samliew,

many thanks!

  1. Source Bundle:
    Bundle_Content.json (18.2 KB)

  2. Target JSON:
    target_JSON.json (332 Bytes)

You need a total of four modules

blueprint.json (29.3 KB)

Output

3 Likes