UiPath Documentation
studiox
2024.10
true
Importante :
A tradução automática foi aplicada parcialmente neste conteúdo. A localização de um conteúdo recém-publicado pode levar de 1 a 2 semanas para ficar disponível.
UiPath logo, featuring letters U and I in white

StudioX user guide

Última atualização 30 de abr de 2026

Tutorial: Adicionando suas Próprias Fórmulas ao Project Notebook

The default Project Notebook available with all automation projects comes with a number of formulas that can be easily incorporated in your automations when selected from the docs image menu of activity fields. In this tutorial, we will create a simple currency conversion automation that demonstrates how you can add a formula of your own to the Project Notebook and use it in your project.

Começaremos adicionando manualmente uma fórmula para converter USD em EUR na célula C1 da planilha do Scratchpad no Notebook e, em seguida, criaremos uma automação que realiza as seguintes tarefas:

  1. Recupera a taxa de câmbio do dólar americano para o euro em uma pesquisa na web e a adiciona na célula A1.
  2. Solicita um valor em USD durante a execução do projeto e adiciona o valor na célula B1.
  3. Exibe uma caixa de mensagem com o equivalente em EUR do valor em USD calculado na célula C1.

Para encerrar as coisas, iremos preparar a nossa automação preparada para o futuro contra quaisquer alterações no Project Notebook, nomeando as células usadas na automação e atualizando o projeto para usar as células nomeadas.

  1. Configure um projeto e atualize o Notebook do projeto.

    1. Create a new blank project using the default settings.
    2. Click Notebook in the StudioX ribbon to open the file in Excel.
    3. No arquivo do Excel, selecione a planilha Scratchpad e, em seguida, insira a fórmula =A1*B1 na célula C1. Esta fórmula converte o valor em USD adicionado na célula B1 em EUR usando a taxa de câmbio adicionada na célula A1.
    4. Salve e feche o Notebook do Projeto.
    5. This example uses Google Chrome, which requires the UiPath® extension for Chrome to be installed. To install it, go to Home (StudioX Backstage View) > Tools, and then, under UiPath Extensions, click Chrome.
  2. Obtenha a taxa de câmbio da Web.

    1. Open Google Chrome, navigate to google.com, and search for usd to euro exchange rate.

    2. In StudioX, click Imagem dos documentos in the Designer panel, and then find the Use Application/Browser activity in the search box at the top of the screen and select it. The activity is added to the Designer panel.

    3. In the Use Application/Browser activity, click Indicate application, then move the mouse to the page with the search results for the exchange rate and, when the browser page is highlighted in blue, click anywhere inside it.

      Você indicou que deseja usar a página com os resultados da pesquisa em sua automação.

    4. Click Imagem dos documentos inside the Use Application/Browser activity, and then find the Get Text activity in the search box at the top of the screen and select it. The activity is added to the Designer panel.

    5. Na atividade Get Text:

      • Clique em Indicar destino na tela, em seguida mova o ponteiro do mouse sobre o valor em Euro na parte superior da página de resultados da pesquisa na web e, quando estiver destacado, clique no valor. O valor é identificado como o alvo e destacado em verde. Clique em Confirmar na janela Opções de Seleção para salvar a seleção. Uma imagem do alvo e de qualquer âncora identificada é exibida na atividade Get Text.

      • Click docs image on the right side of the Save to field, and then select Notebook > Indicate in Excel. In Excel, select cell A1, and then click Confirm in the UiPath tab in the Excel ribbon. You have indicated that you want to paste the exchange rate in cell A1 in the Scratchpad sheet of the Project Notebook.

        Imagem dos documentos

  3. Solicitar um valor em dólares americanos e exibir seu equivalente em euros.

    1. Click Imagem dos documentos below the Get Text activity, and then find the Write Cell activity in the search box at the top of the screen and select it. The activity is added to the Designer panel.

    2. Na atividade Write Cell:

      • Click Imagem dos documentos on the right side of the What to write field, and then select Ask when run.

      • Click docs image on the right side of the Where to write field, and then select Notebook > Indicate in Excel. In Excel, select cell B1, and then click Confirm in the UiPath tab in the Excel ribbon.

        Você indicou que deseja solicitar ao usuário um montante em USD durante a execução do projeto e que deseja colar este valor na célula B1 na folha de rascunho do Notebook.

    3. Click Imagem dos documentos below the Write Text activity, and then find the Message Box activity in the search box at the top of the screen and select it. The activity is added to the Designer panel.

    4. In the Message Box activity, click Imagem dos documentos on the right side of the Message field, and then select Text.

    5. Queremos exibir a mensagem "X USD é equivalente a Y EUR". Para conseguir isso, no Construtor de Texto:

      • Click Imagem dos documentos on the right side of the text box, and then select Project Notebook (Notes) > Indicate in Excel. In Excel, select cell C1, and then click Confirm in the UiPath tab in the Excel ribbon..

      • Insira o texto USD is the equivalent of

      • Click Imagem dos documentos on the right side of the text box, and then select Project Notebook (Notes) > Indicate in Excel. In Excel, select cell B1, and then click Confirm in the UiPath tab in the Excel ribbon..

      • Insira o texto EUR.

        O texto deve se parecer com a imagem a seguir.

        Imagem dos documentos

    6. Clique em Salvar no Construtor de Texto, em seguida clique em Salvar na faixa de opções do StudioX para salvar a automação e clique em Executar para executar a automação.

      Imagem dos documentos

      A taxa de câmbio é obtida da pesquisa na web, o usuário é solicitado a inserir um valor, o valor é convertido de USD para EUR no Excel e uma mensagem é exibida com o resultado da conversão.

  4. Otimizar sua automação nomeando as células no Notebook do Projeto.

    Sua automação agora está totalmente funcional, mas você pode melhorá-la ainda mais nomeando as células usadas nela e atualizando as atividades que fazem referência a elas. Nomear células tem as seguintes vantagens:

    • When configuring activities, you can select named cells directly from the Imagem dos documentos menu, without having to open the file and indicate in Excel.

    • Identificar células por nome em vez de por referência significa que você não precisa se preocupar em atualizar atividades para apontar para as células corretas se as alterações no arquivo do Excel fizerem as células ser deslocadas.

      Para nomear as células e atualizar o projeto:

    1. Abra o Project Notebook no Excel e renomeie as seguintes células na planilha Scratchpad usando a Caixa de nome na extremidade esquerda da barra de fórmulas: para a célula A1, insira o nome ExchangeRate, para a célula B1, insira o nome USDValue e para a célula C1, insira o nome EURValue.
    2. Atualize as atividades no projeto para usar os nomes das células:
      • In the Get Text activity, click Imagem dos documentos on the right side of the Save to field, and then select Project Notebook (Notes) > Scratchpad [Sheet] > ExchangeRate.
      • In the Write Cell activity, click Imagem dos documentos on the right side of the Where to write field, and then select Project Notebook (Notes) > Scratchpad [Sheet] > USDValue.
      • In the Message Box activity, click docs image, then select Text and update the two references to cells in Excel:
        • Delete [Excel] Scratchpad!B1, then click Imagem dos documentos on the right side of the text box and select Project Notebook (Notes) > Scratchpad [Sheet] > USDValue.

        • Delete [Excel] Scratchpad!C1, then click Imagem dos documentos on the right side of the text box and select Project Notebook (Notes) > Scratchpad [Sheet] > EURValue.

          O projeto atualizado deve se parecer com a imagem a seguir.

          Imagem dos documentos

Esta página foi útil?

Conectar

Precisa de ajuda? Suporte

Quer aprender? Academia UiPath

Tem perguntas? Fórum do UiPath

Fique por dentro das novidades