Task 2: Create a prompt
-
Go to Topics, and open Check Ticket Status.
Our goal is to use Generative AI to draft a letter to the user based on the issue raised in the ServiceNow ticket
-
After the last message that contained an Adaptive Card, add another node with the (+) button.
After pressing the (+) button, the + changes to an X as shown. Choose Call an action and select Create a prompt (view screenshot below).
-
Give it a name Ticket customer communication.
-
Add an Input, called Ticket Details. You will find 4 buttons on the right hand side, the top one is the input button and it will open the dialog shown below.
-
Test your prompt by pasting the ServiceNow Sample JSON Payload from Lab 3 in the input Sample data field and selecting Test prompt.
-
In the Prompt, paste the below instructions:
Based on the ticket details, write a pesonalized apologetic message to the person impacted. You can summarize the issue to show you understand it. Show empathy and suggest ways to mitigate the situation based on the ticket details. Have a positive attitude and use emojis when applicable. Don't include hashtags. Text should be a single paragraph.
-
Add the text ## Ticket Details at the bottom of the new text.
-
Under the ## Ticket details section, use the Insert button to select the Input Text option.
-
Under Settings, choose Model GPT-4o (vs GPT-40 mini).
Settings is the gear symbol , the 4th icon on the right side
-
Select Save custom prompt.
-
Select the SNTicketInfo variable for the Details input.
-
Create a variable for the generated output: PersonalizedMessage. Do this by clicking on the second box under output ans select Create variable. By default you will get a new variable called Var 1. Edit this variable and change the name to PersonalizedMessage. It will have a default type of record
-
Add a Message node, and insert the PersonalizedMessage.text variable. To insert the variable click on {x} symbol
-
Select Save.
-
Test by entering the following prompt:
What’s the latest on ticket INC0007001, please?
Summary
Thank you for completing Exercise 7 ‘Use generative AI orchestration to interact with your connectors’. You have successfully:
• Created a custom prompt from Copilot Studio
• Passed it inputs and used its output as a generated answer for the end-user