---
sourceDocument: Australia Build workflows
sourceDocumentLink: https://servicenow-prod.fluidtopics.net/r/build-workflows

 Release :

    - australia

ft:locale :

    - en-US

ft:publication_title :

    - Australia Build workflows

ft:clusterId :

    - crworkflow

bundleId :

    - crworkflow

workflow :

    - Creator


---

# Create decision table code snippets

# Create decision table code snippets {#ariaid-title1}

* Release version: Australia
* 
* Updated July 22, 2026
* 
* ![](https://www.servicenow.com/docs/portal-asset/ico-clock) 1 minute to read

Create code snippets of published decision tables in Workflow Studio to execute the decision table from any script and make it easier to replace hard-coded logic with decisions.

## Before you begin

If you have draft authoring enabled, you must publish your decision table to copy a code snippet of the table. If draft authoring is not enabled, save your decision table to access this feature.

Copying code snippets for a decision table lets you quickly insert the table into your script without authoring the code manually. For more information about the Decision table API, see [DecisionTableAPI - Scoped, Global](https://www.servicenow.com/docs/access?context=DecisionTableAPI&version=australia&pubname=australia-api-reference&ft:locale=en-US).

Role required: none

## Procedure

1. Navigate to AllProcess AutomationWorkflow Studio.
2. On the homepage, select Decision tables.
3. Open a published decision table.
4. Select the Decision table menu options icon (![]()) and select Create Code Snippet.  
   Two code snippets are generated. The first code snippet calls the GetDecision() API, which returns only the first result that matches the inputs and specifications in the decision table. The second code snippet calls the GetDecisions() API, which returns a list of all the results that match your inputs.
5. Select either Return first decision that matches or Return all decisions that match depending on which code snippet you need.
6. Select Copy Code.
7. **Optional:** To copy the other code snippet, select OK to close the confirmation message, and copy the code from the other option.
8. Insert the code snippet into your script where you want to call the decision table and define the data to use for each input variable.

*[\>]: and then


