Structure of the Note

  1. Note ID: Each note is assigned a unique identifier for execution.

  2. Note Name: A human-readable title, such as ” XYZ Report Results”, is used to make the purpose clear.

  3. Note Type:   sql, snowpark_python

    • Select SQL for querying databases or Snowpark Python for calculations and programmatically processing the data.
  4. Note Content: For SQL: Ensure the query fetches all necessary fields, applies appropriate conditions and filters, and uses proper joins (if needed). For Snowpark Python: Structure the logic in reusable functions for calculations or data wrangling.

  5. Parameters (if any): Allows flexibility for input values to modify or tailor queries dynamically.

Step-by-Step: How to Create a Note Using Notebook Tools

The example we will be using will be creating the note used in the “Autonomous Actionable Data Analysis” example.

Step 1: Start By Asking To Create A New Note

User: I want to create a new note.

Step 2: Provide The Note Details

User: 
1. DCR Report Result
2. SQL
3. SELECT RESULTS, report_name FROM SAMOOHA_BY_SNOWFLAKE_LOCAL_DB.PUBLIC.REPORTS

We provided the above because:

1. Uses a consistent naming convention that highlights the objective. Upon note creation, the note ID will be automatically populated following a naming convention such as <bot_id>_<task_name>_<random_id>

2. we selected SQL as the note type for querying databases.

3. we ensured the query fetches all necessary fields, applies appropriate conditions and filters, and uses proper joins (if needed).

4. If variability is needed, create placeholders for values such as QUARTER or CAMPAIGN_ID using Genbots parameter variables. Example:

  • Parameterized SQL: WHERE QUARTER = ${quarter}

  • Parameter: quarter = 2024Q2

Note: For this specific note we want to create a static reusable SQL query that the Genbot can’t change when processing.

  • Upon creation of the note, we can now choose to also include it within an autonomous process if needed. To learn more about creating an autonomous process refer to the “How To Use Process Runner Tools” section.

Step 3: Testing The Created Note

Now that the note has been successfully created, you can test the note by simply asking the Genbot to run the note name or note id.