Explore more
Connections
Replace connections across multiple modules
10 min
in {{product name}} , you may occasionally need to replace a connection that's used in multiple modules of the same app across one or many scenarios this might be necessary when you've switched accounts the authentication method has been changed you need to replace the connection instead of editing the credentials for an existing one instead of replacing each connection manually, you can choose one of the two methods, depending on where the connection is used replace connections across multiple modules /#replace the connection within one scenario replace connections across multiple modules /#replace connections within multiple scenarios replace the connection within one scenario use this method when multiple modules in the same scenario use the connection you want to replace you'll need the make devtool installed see the installation instructions here open the scenario in {{product name}} where you want to change the connection click any module that will use the new connection , then click add next to the connection field complete the required steps to create and save your new connection open chrome developer tools windows control+shift+i or f12 mac fn+f12 use a horizontal dock for better visibility click the three dots in the toolbar's right corner to configure this switch to the make tab in the developer tools in the left sidebar, click tools , then select swap connection in the source module field, select the module where you’ve created the new connection the number in brackets helps you locate it in the scenario builder in the target module field, add the modules where you want to change the connection leave it empty to update all the modules of the same app in the scenario click run wait for the “run completed” message, and click done all modules from the app in this scenario now use the new connection replace connections within multiple scenarios if you need to update the connection used in multiple scenarios, using {{product name}} devtool may be time consuming instead, you can use make app modules to replace connections across multiple scenarios for that, you need to replace connections across multiple modules /#obtain the ids of the old and new connections replace connections across multiple modules /#create a scenario to replace connections the {{product name}} app is only available on paid plans obtain the ids of the old and new connections to change the connection across multiple scenarios, you'll first need to obtain the ids of both the old and new connections before you begin, make sure you’ve already created the new connection in at least one scenario if not, follow these steps to create a new connection, then return here to continue log in to your {{product name}} account and click + create new scenario add the make app and select the list connections in a team module configure the module settings in the connection field, choose your {{product name}} connection if you use an api connection, make sure your api key has the organizations\ read and connections\ read scopes in the team id field, click search teams , and select the required team optional in the type field, you can enter the app name, if you know the exact one the app name is typically the name of the service (e g , shopify, notion, facebook) if the app offers more than one connection type, the name may have a number appended (e g , slack2, airtable3) for apps with compound names, dashes are used (e g , google forms, google sheets) you can also check the exact app name using the make devtool's highlight app feature see the instructions here optional in the limit field, you can specify how many connections you want to get in the output click save click the run once button in the {{scenario singular}} builder toolbar click the operation bubble above the module in the output , expand body > connections in the output, you will see your new and old connections' respective ids your new and old connections' names to identify the old and new connection names, compare the name in the output with the name used when creating the connection under account name , the type of connection you searched for copy the ids for the next steps create a scenario to replace connections you can use our template with a pre set scenario to replace the connection, or create a scenario yourself in the latter case , you'll need to complete the steps described below to find the relevant scenarios, get their blueprints, and update them using the make app in your {{product name}} account, click + create new scenario add the tools > set multiple variables module, and set two variables obtained from the previous step item 1 old connection id (variable name) and its id (variable value) item 2 new connection id (variable name) and its id (variable value) click save to find all the scenarios that use the old connection you want to replace, add the make > search scenarios module configure the module settings in the connection field, choose your {{product name}} connection select your organization and team select the folder if the required scenarios are stored in a particular folder use filters to refine the search by default and/or custom properties for example, if you need to search for scenarios created by you choose which scenarios to include in the search active, inactive, or all in the limit field, specify how many scenarios to return in the output click save optional add a filter after this module to further narrow down the scenarios that need to be edited this may be relevant if the search scenarios module doesn’t allow filtering by the parameters you need to retrieve the scenario blueprint you'll work with, add the make > get a scenario blueprint module configure the module settings in the connection field, choose your make connection in the scenario id field, map the scenario id from the search scenarios module click show advanced settings , and select json string in the return a blueprint field click save optional add a filter for the connection id to ensure that only scenarios containing the old connection are updated enter tostring (map blueprint from the get a scenario blueprint module ) to the condition field choose text operator contains enter (" imtconn " map the old connection variable from the set a variable module) optional you can temporarily add a tools > text aggregator module after the make > get a scenario blueprint module this will list all scenarios that are about to be updated, helping you confirm that the connections will be replaced in the correct scenarios once you've verified that, you can either disconnect or delete the text aggregator module to update the scenarios that use the old connection with a new connection, add the make > update a scenario module configure the module settings in the connection field, choose your {{product name}} connection in the scenario id field, map the scenario id from the search scenarios module in the blueprint field, add a replace function, map the blueprint , and add the old and new connection ids in the following formats " imtconn " connection id leave the scenario name and folder id fields blank click save click the run once button in the scenario builder toolbar all the old connections in the scenarios you selected will be updated to new ones how to confirm the connections are replaced correctly to verify that the right connections have been replaced in your scenarios, follow these steps after running the full scenario, add a tools > text aggregator module after the make > update a scenario module select make > update a scenario as a source module, and map name and scenario id from that module run the scenario again if the connection was successfully replaced, this second run should return 0 results (i e , there’s nothing to replace) after running the full scenario, you can also set a filter to find scenarios that use the new connection enter tostring (map blueprint from the get a scenario blueprint module ) to the condition field choose text operator contains enter (" imtconn " map the new connection variable from the set a variable module) if you run the scenario again, it should return all scenarios that have the replaced connection troubleshooting here you can find solutions for the most common issues when replacing the connection across multiple modules in {{product name}} don’t see any or certain scenarios from the search scenario module make sure you’ve selected the correct organization , team, and folder (if applicable) check whether the filters you’ve set match the properties of the scenarios you’re looking for review the limit field to ensure you’re not cutting off results ensure you are filtering the correct connection id the update a scenario module fails or doesn’t update anything confirm that the blueprint field is filled in correctly, including the proper replace () syntax double check that the blueprint actually contains the old connection id you’re trying to replace verify that you are editing the correct app connection what happens if you update scenarios incorrectly an incorrect update can break the connections in your scenarios it’s best to test your setup on one or two scenarios first before applying changes in bulk additionally, you can use the tools > text aggregator module after the make > get a scenario blueprint module, as explained above this will display a list of all scenarios that are about to be updated, helping you confirm that the connections will be replaced in the correct scenarios you can also restore a previous scenario version if something goes wrong