Example of prompt to loop logic

Developers can use Co-Pilot for Automators to quickly build loop logic in bot automation using natural language in an instructional prompt.

This example demonstrates designing a prompt to build a bot automation that loops through emails and saves contact details of each sender in an Excel file. Notice that after the prompt is entered, Co-Pilot for Automators automatically generates and sequences the necessary actions and iterator type in a structure for you to verify and complete by setting values for your individual use case.

This example intends to demonstrate the experience and steps to take when applying Co-Pilot for Automators to developing loop logic. The results from more sophisticated prompts, generating more complex scenarios, do require examination with attention to detail to ensure results match expectations. Any generated variables and connections follow default labeling when interpreted by the language used in your prompt.

Procedure

  1. From a new project in the Bot editor, click Co-Pilot to open Co-Pilot for Automators.
  2. Enter the following prompt: Connect to my email and loop through unread emails and insert details of all senders in a new excel file and save the file.
    The necessary actions are added to the canvas. You can disregard the comment that might appear, as it is simply a notification generated from your prompt, unless you find the comment relevant to your automation needs.

    Image demonstrates the results from the prompt input.
  3. Necessary variables have been populated and mapped to the actions of the automation. Examine these for necessary improvements for your individual automation.
    1. In the Email: Connect action, variables for your individual server require data for $pStrServerhost$ and $pNumPort$.
    2. The variables $pCredUsername$ and $pCredSecuredpassword$ require your individual Username and Password.

    Image demonstrates the email variables that need values.
  4. The Loop action is configured for unread mail in your Inbox folder. You can make this automation more specific by editing the type of email or folder.

    Image demonstrates the type of iterator.
  5. The Excel advanced: Insert action is configured to insert at the variable $pNumInsertrownumber$. Edit this variable to insert data at your desired row or column in Excel.

    Image demonstrates the insert variable the needs a value.
  6. Finally, test and save your automation.