> Portal Navigation: > > - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version. > - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages). > - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`). > - Top-level index of all portals: https://dev.wix.com/docs/llms.txt > - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt # CopyInputMapping # Package: actions # Namespace: ActionCatalogService # Method link: https://dev.wix.com/docs/api-reference/business-management/automations/actions/action-catalog/copy-input-mapping.md ## Permission Scopes: Set Up Automations: SCOPE.CRM.SETUP-AUTOMATIONS ## Introduction Retrieves a copy of an action's input mapping, with any per-action unique values regenerated. Used by the automations editor when a Wix user duplicates an action that contains values, such as IDs, that must remain unique across multiple actions. If the action's service plugin implements `DuplicateInputMapping`, the input mapping is passed through it; otherwise, the original input mapping is returned unchanged. --- ## REST API ### Schema ``` Method: copyInputMapping Description: Retrieves a copy of an action's input mapping, with any per-action unique values regenerated. Used by the automations editor when a Wix user duplicates an action that contains values, such as GUIDs, that must remain unique across multiple actions. If the action's service plugin implements `DuplicateInputMapping`, the input mapping is passed through it; otherwise, the original input mapping is returned unchanged. URL: https://www.wixapis.com/v1/actions/copy Method: POST # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present. Required parameters: appId, actionKey, inputMapping Method parameters: param name: actionKey | type: actionKey | description: Action key. Learn about [adding an action to your app](https://dev.wix.com/docs/api-reference/business-management/automations/actions/add-an-action-to-your-app.md). | required: true | validation: maxLength 100 param name: appId | type: appId | description: GUID of the app that defines the action. | required: true | validation: format GUID param name: inputMapping | type: inputMapping | description: Input mapping to copy. | required: true Return type: CopyInputMappingResponse - name: inputMapping | type: object | description: Copied input mapping, with any per-action unique values regenerated. Possible Errors: HTTP Code: 404 | Status Code: NOT_FOUND | Application Code: ACTION_SPI_NOT_FOUND | Description: The requested action does not have a matching service plugin implementer. ``` ### Examples ### Copy input mapping ```curl curl -X POST 'https://www.wixapis.com/v1/actions/copy' \ -H 'Authorization: ' \ -H 'Content-Type: application/json' \ -d '{ "appId": "e4c3e640-0b63-4bd9-8574-53f8c14e0236", "actionKey": "send-gift-card", "inputMapping": { "contactId": "{{var(\"contact.id\")}}", "amount": 50, "giftCardId": "b7e2f8a1-3c4d-4e5f-a6b7-8c9d0e1f2a3b" } }' ``` --- ## JavaScript SDK ### Schema ``` Method: wixClientAdmin.actions.ActionCatalogService.copyInputMapping(appId, options) Description: Retrieves a copy of an action's input mapping, with any per-action unique values regenerated. Used by the automations editor when a Wix user duplicates an action that contains values, such as GUIDs, that must remain unique across multiple actions. If the action's service plugin implements `DuplicateInputMapping`, the input mapping is passed through it; otherwise, the original input mapping is returned unchanged. # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present. Required parameters: appId, options.actionKey, options.inputMapping, options Method parameters: param name: appId | type: string | description: GUID of the app that defines the action. | required: true | validation: format GUID param name: options | type: CopyInputMappingOptions none | required: true - name: actionKey | type: string | description: Action key. Learn about [adding an action to your app](https://dev.wix.com/docs/api-reference/business-management/automations/actions/add-an-action-to-your-app.md). | required: true | validation: maxLength 100 - name: inputMapping | type: object | description: Input mapping to copy. | required: true Return type: PROMISE - name: inputMapping | type: object | description: Copied input mapping, with any per-action unique values regenerated. Possible Errors: HTTP Code: 404 | Status Code: NOT_FOUND | Application Code: ACTION_SPI_NOT_FOUND | Description: The requested action does not have a matching service plugin implementer. ``` ### Examples ### Copy input mapping Copies an action's input mapping with unique values regenerated. ```javascript import { actionCatalog } from "@wix/automations"; async function copyInputMapping() { const response = await actionCatalog.copyInputMapping({ appId: "e4c3e640-0b63-4bd9-8574-53f8c14e0236", actionKey: "send-gift-card", inputMapping: { contactId: "{{var(\"contact.id\")}}", amount: 50, giftCardId: "b7e2f8a1-3c4d-4e5f-a6b7-8c9d0e1f2a3b", }, }); return response; } /* Promise resolves to: * { * "inputMapping": { * "contactId": "{{var(\"contact.id\")}}", * "amount": 50, * "giftCardId": "d9f4a2c3-5e6f-7a8b-c9d0-1e2f3a4b5c6d" * } * } */ ``` ### copyInputMapping (self-hosted) Self-hosted SDK calls require you to [create a client](https://dev.wix.com/docs/sdk/articles/work-with-the-sdk/about-the-wix-client.md). ```javascript import { createClient } from '@wix/sdk'; import { actionCatalog } from '@wix/automations'; // Import the auth strategy for the relevant access type // Import the relevant host module if needed const myWixClient = createClient ({ modules: { actionCatalog }, // Include the auth strategy and host as relevant }); async function copyInputMapping(appId,options) { const response = await myWixClient.actionCatalog.copyInputMapping(appId,options); }; ``` ---