Code generation

  • Release version: Washingtondc
  • Updated February 1, 2024
  • 1 minute to read
  • Code generation is designed to empower developers to write scripts quickly with AI-generated code based on text or code prompts and can improve time to value for applications.

    Overview

    Now Assist for Creator activates the code generation skill. With code generation, you provide text describing the code to generate and get code suggestions in the JavaScript editor on forms in the ServiceNow AI Platform and in Script steps in Flow Designer. Developers with varying levels of experience in scripting on the ServiceNow AI Platform can benefit from using code generation to get started writing custom scripts or iterate on scripts more efficiently.

    Note:
    Now LLM Service is currently the only provider for this Now Assist application's skills.

    To generate code suggestions, you describe the goal of the code to generate in the Code with Now Assist dialog box. The code suggestion appears in the lines following your prompt but isn’t added to your script until it's accepted.

    Code with Now Assist dialog box with the text "Validate emails using regex" and a code suggestion in the script editor.

    Optionally, you can turn on code completion functionality to use code or single-shot prompts in script editors with Now Assist for code generation.

    Developers must be assigned the now.assist.creator role to use code generation. To get started developing with AI-generated code, see Now Assist for code generation.

    Availability

    This skill is available in the workflow and product listed below.

    Table 1. Now Assist products and workflows
    Workflow Product
    Creator Now Assist for Creator