--- title: "Create Scripts for a Content Type" slug: "create-scripts-for-a-content-type" description: "This article will show you how to create scripts for a Content Type. " updated: 2026-07-09T17:56:59Z published: 2026-07-09T17:56:59Z canonical: "www.civicplus.help/create-scripts-for-a-content-type" --- > ## Documentation Index > Fetch the complete documentation index at: https://www.civicplus.help/llms.txt > Use this file to discover all available pages before exploring further. # Create Scripts for a Content Type This article will show you how to create scripts for a Content Type. Scripts can be used for many different purposes such as validation and providing additional security or permissions on a specific content type. The HCMS provides many generic, easy-to-use options for validation and security, such as [permission sets](/civicplus-help-center/docs/), [roles](/civicplus-help-center/docs/), and [workflows](/civicplus-help-center/docs/). Scripts can be used to handle gaps and address specific use cases that other areas of the HCMS do not address. Scripts can provide more specific controls that can be set for a given field when certain information is added to or missing from a field, or even for a single user. ## Example Uses of Scripts While the options for scripts are endless, here are some examples that could get you started: - If you did not fill out this field, you could use a script to autofill the content for a field - You could use a script to fill out a field every time an item is created. An example of this is on the Department content type (for newer HCMS applications) where Staff Directory information is auto-filled each time a Department content item is created - Only a single person could create something or update a field (an “Approval” field, for example) - Verify whether something was filled out or not - Only publish if certain criteria are met (such as an item can only be published if the above-mentioned “Approval” field has been approved by a single individual) - Prevent someone from deleting an item > [!TIP] > Who can use this feature? > > Owner | Developer | Publisher | Author (submit for review) --- ## Instructions [Embedded content](https://www.iorad.com/player/1580247/HCMS--How-to-Create-Scripts-for-a-Content-Type-Practice-Tutorial) 1. [Sign in to the HCMS](/civicplus-help-center/docs/sign-in-to-the-hcms) 2. Select **Content Types** on the left-hand side and select your desired Content Type ![Content Types section showing various types including a highlighted Department entry.](https://cdn.us.document360.io/17dc564a-8310-4f61-b929-1bd73b36e158/Images/Documentation/Select Content Type - HCMS.png?sv=2026-02-06&spr=https&st=2026-11-22T13%3A15%3A02Z&se=2026-11-22T14%3A15%3A02Z&sr=b&sp=r&sig=sY%2FwlXWjKCJIWMxKiozKzeRLVDC6gAfsvRNLph7%2FXhg%3D) 3. Navigate to the **Scripts** tab ![The Scripts tab at the top of the Content Type editor.](https://cdn.us.document360.io/17dc564a-8310-4f61-b929-1bd73b36e158/Images/Documentation/Scripts%20Tab%20-%20HCMS.png?sv=2026-02-06&spr=https&st=2026-11-22T13%3A15%3A02Z&se=2026-11-22T14%3A15%3A02Z&sr=b&sp=r&sig=3T%2B0RC7PatEKRkaUFtPiKxqM6f%2Fd4120qP7mtErJlxQ%3D) 4. Add Scripts to **Query**, **Create**, **Change**, **Delete**, and/or **Update![Highlighted options for Query, Create, Change, Delete, and Update in a script interface.](https://cdn.us.document360.io/17dc564a-8310-4f61-b929-1bd73b36e158/Images/Documentation/Scripts%20Sub-Tabs%20-%20HCMS.png?sv=2026-02-06&spr=https&st=2026-11-22T13%3A15%3A02Z&se=2026-11-22T14%3A15%3A02Z&sr=b&sp=r&sig=uZj0z36zWyYIIKoDGBjBxXn3ggTHlAQF0EnIQnbJaZ8%3D)** > [!WARNING] > **Note**: There are some restrictions for scripts which include: > > - You cannot include external libraries. > - You cannot make calls to external services except get JSON. > - Scripts will timeout after 200ms of CPU execution. > - Scripts will timeout after 5 seconds of total execution, such as waiting for external services with get JSON.Learn more about script [variables](/civicplus-help-center/docs/variables-for-scripts), [methods](/civicplus-help-center/docs/script-methods), and [use cases](/civicplus-help-center/docs/script-use-cases). - **Query:** These scripts are executed whenever a content item is queried with the API (such as from your Web Evolve website), but not when queried in the HCMS user interface. - **Create:** Scripts are executed before a content item is created. - **Change:** Scripts are executed before the status of a content item is changed. When you use scheduling to change the status of a content item in the future, the script is called just before the status is changed and not when you schedule it. When the script fails or rejects the change, your scheduling could be impacted. - **Delete:** Scripts are executed before a content item is deleted. - **Update:** Scripts are executed before a content item is updated. 5. Click **Save** ![The Save button on the Scripts tab of a Content Type.](https://cdn.us.document360.io/17dc564a-8310-4f61-b929-1bd73b36e158/Images/Documentation/Save%20Scripts%20-%20HCMS.png?sv=2026-02-06&spr=https&st=2026-11-22T13%3A15%3A02Z&se=2026-11-22T14%3A15%3A02Z&sr=b&sp=r&sig=30cW%2BXRaUnCKT9eM8uQOVq6MfvDr2KZ0u1r66AW1mnU%3D) JavaScript Object Notation. Central Processing Unit Application Programming Interface. A set of rules that allows programmers to develop software for a particular operating system without having to be completely familiar with that operating system.