---
sourceDocument: Yokohama-API-Referenz
sourceDocumentLink: https://servicenow-prod.fluidtopics.net/r/de-DE/yokohama/api-reference

 Release :

    - yokohama

ft:locale :

    - de-DE

ft:publication_title :

    - Yokohama-API-Referenz

ft:clusterId :

    - crapiref

bundleId :

    - crapiref

workflow :

    - Creator


---

# Zugriff auf das Workflow-Scratchpad über Business-Regeln

# Zugriff auf das Workflow-Scratchpad über Business-Regeln {#ariaid-title1}

* Freigeben Version: Yokohama
* 
* Aktualisiert 30. Januar 2025
* 
* ![](https://www.servicenow.com/docs/portal-asset/ico-clock) 1 Minute Lesedauer

Ein Katalogelement wurde angefordert, und der angehängte Workflow enthält eine Skriptausführungsaktivität, die einen Wert im Scratchpad ausfüllt. Aus einer Business-Regel, die für das angeforderte Element ausgeführt wird, möchten Sie Scratchpad-Werte abrufen oder festlegen.

## Voraussetzungen

Erforderliche Rolle: admin.

Name: Greifen Sie über Business-Regeln auf das Workflow-Scratchpad zu.

Typ: Business-Regel.

Tabelle: sc_req_item (angefordertes Element).

Beschreibung: Ein Katalogelement wurde angefordert. Der angehängte Workflow enthält eine Aktivität zum Ausführen des Skripts, die einen Wert im Scratchpad ausfüllt. Aus einer Business-Regel, die für das angeforderte Element ausgeführt wird, möchten Sie Scratchpad-Werte abrufen oder festlegen.

Parameter: n/a.  
Skript:

    //the run script activity sets a value in the scratchpad
    workflow.scratchpad.important_msg = "scratch me";
     
    //get the workflow script include helper 
    var workflow = new Workflow();
     
    //get the requested items workflow context 
    //this will get all contexts so you will need to get the proper one if you have multiple workflows for a record 
    var context = workflow.getContexts(current); 
    //make sure we have a valid context 
    if (context.next()) { 
      //get a value from the scratchpad 
      var msg = context.scratchpad.important_msg; 
      //msg now equals "scratch me", that was set in the run script activity
     
      //add or modify a scratchpad value
      context.scratchpad.status = "completed"; 
      //we need to save the context record to save the scratchpad
      context.update(); 
    }


