logo
logo

Create a new script

Warning

All scripts in Sitecore Content Hub™ are restricted. Unrestricted scripts are obsolete.

  1. Go the the Manage page, type 'scripts' in the search bar, and select Scripts:

  2. Click + Script:

  3. In the pop-up screen, enter a Name, and select a Script type from the list:

    Warning

    You cannot change the script type after creation. Make sure you choose the correct script type. All scripts are restricted.

  4. When your script is created, it appears in the scripts list:

  5. Click More options, then click Edit:

  6. Enter your script code in the text area, then click Build:

  7. Wait for the application to finish building your script:

  8. If the build fails, the error message indicates the errors in your script:

    Note

    In this case, the script uses a context property that does not exist for the 'Metadata Processing' script type.

  9. If the build succeeds, it means your script has no errors. Click Done:

  10. Click Publish:

    Important

    The Publish button is only available after the script is built.

    Note

    Publishing the script makes the current version of the code active. Make sure to publish the script for the code changes to take effect.

  11. Click the arrow to get back to the Scripts screen:

  12. To enable your script, switch the toggle:

    Note

    Enabling your script makes it available for use.

Can we improve this article ? Provide feedback

IN THIS ARTICLE