Dengan menggunakan tugas Pemetaan Data, lakukan iterasi pada elemen array string dan terapkan fungsi transformasi untuk menggabungkan nilai string ke semua elemen array.
Klik Integrations dari menu navigasi sebelah kiri untuk membuka halaman Integrations.
Pilih integrasi yang ada atau buat integrasi baru dengan mengklik Buat integrasi.
Jika Anda membuat integrasi baru:
Masukkan nama dan deskripsi dalam dialog Buat Integrasi.
Pilih region untuk integrasi.
Pilih akun layanan untuk integrasi. Anda dapat mengubah atau memperbarui detail akun layanan integrasi kapan saja dari panel infoRingkasan integrasi di toolbar integrasi.
Klik Buat.
Tindakan ini akan membuka integrasi di editor integrasi.
Di editor integrasi, klik publishmenu Upload/download, lalu pilih Upload integrasi.
Dalam dialog file browser, pilih file yang Anda simpan di langkah 1, lalu klik Open.
Versi baru integrasi dibuat menggunakan file yang diupload.
Di editor integrasi, klik Uji.
Klik Uji integrasi. Tindakan ini akan menjalankan integrasi dan menampilkan hasil eksekusi di panel Test Integration.
[[["Mudah dipahami","easyToUnderstand","thumb-up"],["Memecahkan masalah saya","solvedMyProblem","thumb-up"],["Lainnya","otherUp","thumb-up"]],[["Sulit dipahami","hardToUnderstand","thumb-down"],["Informasi atau kode contoh salah","incorrectInformationOrSampleCode","thumb-down"],["Informasi/contoh yang saya butuhkan tidak ada","missingTheInformationSamplesINeed","thumb-down"],["Masalah terjemahan","translationIssue","thumb-down"],["Lainnya","otherDown","thumb-down"]],["Terakhir diperbarui pada 2025-09-08 UTC."],[[["\u003cp\u003eThis guide demonstrates how to use the Data Mapping task within Application Integration to concatenate a string to each element of a string array.\u003c/p\u003e\n"],["\u003cp\u003eThe process involves using the \u003ccode\u003eFOR_EACH\u003c/code\u003e and \u003ccode\u003eCONCAT\u003c/code\u003e functions to iterate through an array and append a specified string value to every element within it.\u003c/p\u003e\n"],["\u003cp\u003eThe sample integration includes an API trigger, a Data Mapping task, and configurations to handle string array manipulation, using provided default values for an initial array and a text to append.\u003c/p\u003e\n"],["\u003cp\u003eInstructions are provided for uploading and testing the sample integration file, by saving it as a .json file, and then uploading it through the Google Cloud console Application Integration page.\u003c/p\u003e\n"],["\u003cp\u003eThe code sample shows the structure of an Application Integration flow that will perform the string array concatenation.\u003c/p\u003e\n"]]],[],null,["# Concat a string to a string array\n\nSee the [supported connectors](/integration-connectors/docs/connector-reference-overview) for Application Integration.\n\nConcat a string to a string array\n=================================\n\n\nUsing the Data Mapping task, iterate through the elements of a string array and apply transformation functions to concat a string value to all the array elements.\n\nCode sample\n-----------\n\n {\n \"triggerConfigs\": [{\n \"label\": \"API Trigger\",\n \"startTasks\": [{\n \"taskId\": \"1\"\n }],\n \"properties\": {\n \"Trigger name\": \"tkApplicationIntegrationSample2_API_1\"\n },\n \"triggerType\": \"API\",\n \"triggerNumber\": \"1\",\n \"triggerId\": \"api_trigger/tkApplicationIntegrationSample2_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\\\": \\\"STRING_ARRAY\\\",\\n \\\"transformExpression\\\": {\\n \\\"initialValue\\\": {\\n \\\"referenceValue\\\": \\\"$stringArray$\\\"\\n },\\n \\\"transformationFunctions\\\": [{\\n \\\"functionType\\\": {\\n \\\"stringArrayFunction\\\": {\\n \\\"functionName\\\": \\\"FOR_EACH\\\"\\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 \\\"stringFunction\\\": {\\n \\\"functionName\\\": \\\"CONCAT\\\"\\n }\\n },\\n \\\"parameters\\\": [{\\n \\\"initialValue\\\": {\\n \\\"referenceValue\\\": \\\"$textToAppend$\\\"\\n }\\n }]\\n }]\\n }\\n }\\n }\\n }]\\n }, {\\n \\\"functionType\\\": {\\n \\\"jsonFunction\\\": {\\n \\\"functionName\\\": \\\"TO_STRING_ARRAY\\\"\\n }\\n }\\n }]\\n }\\n },\\n \\\"outputField\\\": {\\n \\\"referenceKey\\\": \\\"$stringArray$\\\",\\n \\\"fieldType\\\": \\\"STRING_ARRAY\\\",\\n \\\"cardinality\\\": \\\"OPTIONAL\\\"\\n }\\n }]\\n}\"\n }\n }\n },\n \"taskExecutionStrategy\": \"WHEN_ALL_SUCCEED\",\n \"displayName\": \"Data Mapping\"\n }],\n \"integrationParameters\": [{\n \"key\": \"stringArray\",\n \"dataType\": \"STRING_ARRAY\",\n \"defaultValue\": {\n \"stringArray\": {\n \"stringValues\": [\"oranges\", \"apples\", \"bananas\", \"mangos\"]\n }\n },\n \"displayName\": \"stringArray\",\n \"inputOutputType\": \"OUT\"\n }, {\n \"key\": \"textToAppend\",\n \"dataType\": \"STRING_VALUE\",\n \"defaultValue\": {\n \"stringValue\": \"AreGreatFruits\"\n },\n \"displayName\": \"textToAppend\"\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."]]