Click Integrations from the left navigation menu to open the Integrations page.
Select an existing integration or create a new integration by clicking Create integration.
If you are creating a new integration:
Enter a name and description in the Create Integration dialog.
Select a region for the integration.
Select a service account for the integration. You can change or update the service account details of an integration any time from the infoIntegration summary pane in the integration toolbar.
Click Create.
This opens the integration in the integration editor.
In the integration editor, click publishUpload/download menu and then select Upload integration.
In the file browser dialog, select the file that you saved in step 1, and then click Open.
A new version of the integration is created using the uploaded file.
In the integration editor, click Test.
Click Test integration. This runs the integration and displays the execution result in the Test Integration pane.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-04 UTC."],[[["\u003cp\u003eThis content demonstrates how to filter elements within a JSON array using the Data Mapping task in Application Integration.\u003c/p\u003e\n"],["\u003cp\u003eThe process involves using boolean criteria to filter the JSON array, specifically focusing on a \u003ccode\u003eqty\u003c/code\u003e property and determining if it is greater than 500.\u003c/p\u003e\n"],["\u003cp\u003eThe output of the filtering process is stored in a new JSON variable called \u003ccode\u003e$flag_orders\u003c/code\u003e, which will contain only the elements that meet the specified criteria.\u003c/p\u003e\n"],["\u003cp\u003eThe document outlines steps for uploading and running a sample integration that exemplifies this filtering technique, enabling users to replicate the example in their own environments.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eFILTER_ELEMENTS\u003c/code\u003e, \u003ccode\u003eGET_PROPERTY\u003c/code\u003e, \u003ccode\u003eTO_INT\u003c/code\u003e, and \u003ccode\u003eGREATER_THAN\u003c/code\u003e are functions that are utilized for the filtering process inside the integration.\u003c/p\u003e\n"]]],[],null,["# Filter values in a JSON array\n\nSee the [supported connectors](/integration-connectors/docs/connector-reference-overview) for Application Integration.\n\nFilter values in a JSON array\n=============================\n\n\nUsing the Data Mapping task, filter the elements of a JSON array based on boolean criteria, and store the filtered output in a new JSON variable.\n\nCode sample\n-----------\n\n {\n \"triggerConfigs\": [{\n \"label\": \"API Trigger\",\n \"startTasks\": [{\n \"taskId\": \"1\"\n }],\n \"properties\": {\n \"Trigger name\": \"filter_orders_greater_than500_API_1\"\n },\n \"triggerType\": \"API\",\n \"triggerNumber\": \"1\",\n \"triggerId\": \"api_trigger/filter_orders_greater_than500_API_1\"\n }],\n \"taskConfigs\": [{\n \"task\": \"FieldMappingTask\",\n \"taskId\": \"1\",\n \"parameters\": {\n \"FieldMappingConfigTaskParameterKey\": {\n \"key\": \"FieldMappingConfigTaskParameterKey\",\n \"value\": {\n \"jsonValue\": \"{\\n \\\"@type\\\": \\\"type.googleapis.com/enterprise.crm.eventbus.proto.FieldMappingConfig\\\",\\n \\\"mappedFields\\\": [{\\n \\\"inputField\\\": {\\n \\\"fieldType\\\": \\\"JSON_VALUE\\\",\\n \\\"transformExpression\\\": {\\n \\\"initialValue\\\": {\\n \\\"referenceValue\\\": \\\"$orders.orderLines$\\\"\\n },\\n \\\"transformationFunctions\\\": [{\\n \\\"functionType\\\": {\\n \\\"jsonFunction\\\": {\\n \\\"functionName\\\": \\\"FILTER_ELEMENTS\\\"\\n }\\n },\\n \\\"parameters\\\": [{\\n \\\"initialValue\\\": {\\n \\\"literalValue\\\": {\\n \\\"protoValue\\\": {\\n \\\"@type\\\": \\\"type.googleapis.com/enterprise.crm.eventbus.proto.TransformExpression\\\",\\n \\\"initialValue\\\": {\\n \\\"referenceValue\\\": \\\"~x\\\"\\n },\\n \\\"transformationFunctions\\\": [{\\n \\\"functionType\\\": {\\n \\\"jsonFunction\\\": {\\n \\\"functionName\\\": \\\"GET_PROPERTY\\\"\\n }\\n },\\n \\\"parameters\\\": [{\\n \\\"initialValue\\\": {\\n \\\"literalValue\\\": {\\n \\\"stringValue\\\": \\\"qty\\\"\\n }\\n }\\n }]\\n }, {\\n \\\"functionType\\\": {\\n \\\"jsonFunction\\\": {\\n \\\"functionName\\\": \\\"TO_INT\\\"\\n }\\n }\\n }, {\\n \\\"functionType\\\": {\\n \\\"intFunction\\\": {\\n \\\"functionName\\\": \\\"GREATER_THAN\\\"\\n }\\n },\\n \\\"parameters\\\": [{\\n \\\"initialValue\\\": {\\n \\\"literalValue\\\": {\\n \\\"intValue\\\": \\\"500\\\"\\n }\\n }\\n }]\\n }]\\n }\\n }\\n }\\n }]\\n }]\\n }\\n },\\n \\\"outputField\\\": {\\n \\\"referenceKey\\\": \\\"$flag_orders$\\\",\\n \\\"fieldType\\\": \\\"JSON_VALUE\\\",\\n \\\"cardinality\\\": \\\"OPTIONAL\\\"\\n }\\n }]\\n}\"\n }\n }\n },\n \"taskExecutionStrategy\": \"WHEN_ALL_SUCCEED\",\n \"displayName\": \"Data Mapping\"\n }],\n \"integrationParameters\": [{\n \"key\": \"orders\",\n \"dataType\": \"JSON_VALUE\",\n \"defaultValue\": {\n \"jsonValue\": \"{\\n \\\"orderLines\\\": [{\\n \\\"lineNumber\\\": 1.0,\\n \\\"productNumber\\\": 123.0,\\n \\\"unitPrice\\\": 1.0,\\n \\\"qty\\\": 1.0,\\n \\\"taxAmount\\\": 1.0\\n }, {\\n \\\"lineNumber\\\": 2.0,\\n \\\"productNumber\\\": 321.0,\\n \\\"unitPrice\\\": 10.0,\\n \\\"qty\\\": 5.0,\\n \\\"taxAmount\\\": 10.0\\n }, {\\n \\\"lineNumber\\\": 3.0,\\n \\\"productNumber\\\": 456.0,\\n \\\"unitPrice\\\": 10.0,\\n \\\"qty\\\": 1000.0,\\n \\\"taxAmount\\\": 10.0\\n }]\\n}\"\n },\n \"displayName\": \"orders\",\n \"inputOutputType\": \"IN\",\n \"jsonSchema\": \"{\\n \\\"$schema\\\": \\\"http://json-schema.org/draft-04/schema#\\\",\\n \\\"type\\\": \\\"object\\\",\\n \\\"properties\\\": {\\n \\\"orderLines\\\": {\\n \\\"type\\\": \\\"array\\\",\\n \\\"items\\\": {\\n \\\"type\\\": \\\"object\\\",\\n \\\"properties\\\": {\\n \\\"unitPrice\\\": {\\n \\\"type\\\": \\\"number\\\"\\n },\\n \\\"qty\\\": {\\n \\\"type\\\": \\\"number\\\"\\n },\\n \\\"productNumber\\\": {\\n \\\"type\\\": \\\"number\\\"\\n },\\n \\\"lineNumber\\\": {\\n \\\"type\\\": \\\"number\\\"\\n },\\n \\\"taxAmount\\\": {\\n \\\"type\\\": \\\"number\\\"\\n }\\n }\\n }\\n }\\n }\\n}\"\n }, {\n \"key\": \"flag_orders\",\n \"dataType\": \"JSON_VALUE\",\n \"displayName\": \"flag_orders\",\n \"inputOutputType\": \"OUT\",\n \"jsonSchema\": \"{\\n \\\"$schema\\\": \\\"http://json-schema.org/draft-04/schema#\\\",\\n \\\"type\\\": \\\"array\\\",\\n \\\"items\\\": {\\n \\\"type\\\": \\\"object\\\",\\n \\\"properties\\\": {\\n \\\"unitPrice\\\": {\\n \\\"type\\\": \\\"number\\\"\\n },\\n \\\"qty\\\": {\\n \\\"type\\\": \\\"number\\\"\\n },\\n \\\"productNumber\\\": {\\n \\\"type\\\": \\\"number\\\"\\n },\\n \\\"lineNumber\\\": {\\n \\\"type\\\": \\\"number\\\"\\n },\\n \\\"taxAmount\\\": {\\n \\\"type\\\": \\\"number\\\"\\n }\\n }\\n }\\n}\"\n }]\n }\n\n### Sample integration flow\n\nThe following image shows a sample layout of the integration editor for this integration code sample.\n\n\nUpload and run the sample integration\n-------------------------------------\n\nTo upload and run the sample integration, do the following steps:\n\n1. Save the [integration sample](#code-sample) as a .json file on your system.\n2. In the Google Cloud console, go to the **Application Integration** page.\n\n [Go to Application Integration](https://console.cloud.google.com/integrations)\n3. Click **Integrations** from the left navigation menu to open the **Integrations** page.\n4. Select an existing integration or create a new integration by clicking **Create integration** .\n\n\n If you are creating a new integration:\n 1. Enter a name and description in the **Create Integration** dialog.\n 2. Select a region for the integration. **Note:** The **Regions** dropdown only lists the regions provisioned in your Google Cloud project. To provision a new region, Click **Enable Region** . See [Enable new region](/application-integration/docs/enable-new-region) for more information.\n 3. Select a service account for the integration. You can change or update the service account details of an integration any time from the info **Integration summary** pane in the integration toolbar. **Note:** The option to select a service account is displayed only if you have enabled integration governance for the selected region.\n 4. Click **Create**.\n\n\n This opens the integration in the *integration editor*.\n5. In the *integration editor* , click publish**Upload/download menu** and then select **Upload integration**.\n6. In the file browser dialog, select the file that you saved in step 1, and then click **Open** .\n\n A new version of the integration is created using the uploaded file.\n7. In the *integration editor* , click **Test**.\n8. Click **Test integration** . This runs the integration and displays the execution result in the **Test Integration** pane."]]