--- title: Generate code with autocomplete description: The autocomplete feature of ServiceNow Otto for Code provides you with contextually relevant code suggestions. locale: en-US canonical_url: https://www.servicenow.com/docs/r/australia/api-reference/scripts/generate-code-with-autocomplete.html release: australia product: Scripts classification: scripts topic_type: task last_updated: "2026-10-09" reading_time_minutes: 1 breadcrumb: [Use, ServiceNow Otto for Code, Scripting, API implementation, API implementation and reference] --- # Generate code with autocomplete The autocomplete feature of ServiceNow Otto for Code provides you with contextually relevant code suggestions. ## Before you begin Role required: now.assist.creator ## Procedure 1. Navigate to any script editor enabled with ServiceNow Otto for Code. For example, to open a script include form, navigate to **All** > **System Definition** > **Script Includes** and select a script include. 2. Start coding in the script editor. When you stop typing, a code suggestion is displayed in grey within a few seconds. **Note:** Retrieval-Augmented Generation \(RAG\) enhances auto-complete suggestions and minimizes inaccuracies or hallucinations. It may take a few seconds for the code suggestions to appear. 3. Review the code suggestions generated by the AI and decide whether to accept or reject them: - Press the **tab** key to accept the code suggestion. If you accept the code suggestion, it's added to the script. - Press the **esc** key to reject the code suggestion or continue typing. If you reject the code suggestion, it isn't added to the script. 4. After accepting the code suggestions, select **Save**. 5. Select **Update** to save the script. The code suggestion is saved within the script. **Note:** To disable autocomplete for your session, select **Settings** in the script editor and turn off the **Autocomplete** toggle. \[Omitted image "soc-settings.png"\] Alt text: To disable autocomplete for your session, select Settings in the script editor and turn off the Autocomplete toggle.