Not available in SaaS instances
You cannot modify Custom Code Blocks in SaaS instances of Hyperscience. Contact your Hyperscience representative for assistance.
To give you more flexibility in your implementation of Hyperscience, we introduced Custom Code Blocks available in custom flows. These blocks allow you to specify business rules for your submissions to transform, add, and validate data before it reaches your downstream systems. When used in tandem with other blocks, such as Routing, Database, and API Blocks, Custom Code Blocks maximize the potential benefits of Hyperscience at your organization.
For more information about potential uses of Custom Code Blocks, see the "Custom Code Blocks" section of Flow Blocks.
If you want to add a Custom Code Block to your flow, reach out to your Hyperscience representative for assistance. After the block has been added, you will be able to change the block's display name and description in Flow Studio. You will also be able to modify the code.
Modifying code
To give you more control over your flows, we're introducing some basic code-editing capabilities, which we will build upon in future versions of Hyperscience.
DO NOT modify code without guidance from Hyperscience
If you would like to make code changes to a Custom Code Block, reach out to your Hyperscience representative for guidance and instructions. Do not modify code on your own.
With guidance from Hyperscience, you can modify code and import it to your Custom Code Block. All custom code must be written in Python. If you are not comfortable making changes to your code, you can ask your Hyperscience representative to make the changes for you.
Whenever you make changes to your custom code, do so in a non-production environment first (e.g., development, UAT). After you've confirmed that the code works as intended, you can import the new code to your Custom Code Block in production.
Modifying a block's code for the first time
Reach out to your Hyperscience representative to let them know that you would like to make changes to your custom code. They will provide you with the original code and provide instructions.
Make a copy of this file and leave it unedited as a backup.
With the guidance of your Hyperscience representative, make the necessary changes to the Python file they sent you, and save the file.
In your non-production environment, duplicate the flow that contains the Custom Code Block you want to change. To learn how, see Managing Flows.
On the Flows page, click on the duplicated flow, and then click on the Custom Code Block.
In the right-hand sidebar, click Import File.
Drag and drop the edited file in the box provided, or click Choose File to find and open the file on your machine.
Click Import.
Thoroughly test your new code. Your Hyperscience representative will provide guidance in this area.
If your code works as intended, import the new file to your production environment's Custom Code Block, just as you did in your non-production environment.
If your code doesn't work as intended:
Modify the code and save your changes.
In your flow, click on the Custom Code Block, and then click on its menu in the right-hand sidebar ( ).
Click Import a New Version, and import your updated file.
Repeat the testing.
Continue modifying, reimporting, and testing your code until it works as intended.
Modifying imported code
If you’ve imported custom code, you can download the imported file and import a new version of the file. You will use both of these features when modifying imported code.
Reach out to your Hyperscience representative to let them know that you would like to make changes to your custom code. They will provide instructions for the edits.
In your non-production environment, duplicate the flow that contains the Custom Code Block you want to change.
On the Flows page, click on the duplicated flow, and then click on the Custom Code Block.
Click on the menu in the right-hand sidebar ( ), and then click Download File.
Make a copy of this file and leave it unedited as a backup.
With the guidance of your Hyperscience representative, make the necessary changes to the downloaded file, and save your changes.
Click on the menu in the right-hand sidebar, and then click Import a New Version.
Drag and drop the edited file in the box provided, or click Choose File to find and open the file on your machine.
Click Import.
Thoroughly test your new code. Your Hyperscience representative will provide guidance in this area.
If your code works as intended, import the new file to your production environment's Custom Code Block, just as you did in your non-production environment.
If your code doesn't work as intended:
Modify the code and save your changes.
In your flow, click on the Custom Code Block, and then click on its menu in the right-hand side bar.
Click Import a New Version, and import your updated file.
Repeat the testing.
Continue modifying, reimporting, and testing your code until it works as intended.