UiPath Documentation
coding-agents
latest
false
UiPath for Coding Agents 用户指南
重要 :
请注意,此内容已使用机器翻译进行了本地化。 新发布内容的本地化可能需要 1-2 周的时间才能完成。

Recipe: build a coded function

Build, test, and publish a coded function that normalizes an order payload, using a coding agent.

This recipe builds a coded function that normalizes an order payload — trimming whitespace, standardizing IDs, and converting dates to a consistent format. It shows the full loop from your prompt to a function you can call from an automation.

先决条件

  • 已安装uip CLI 和技能,以及已通过身份验证的会话(请参阅安装和设置)。
  • An empty working folder, or an existing project you want to add the function to.

Build the function

  1. Open your coding agent in your working folder.

  2. Describe the transform:

    "Create a coded function that normalizes this order payload: trim whitespace from every string field, uppercase the order ID, and convert the order date to ISO 8601. Here's a sample payload: [paste sample JSON]."

  3. Review the function the agent scaffolds — the input and output contract, and the transform logic.

  4. Ask the agent to run the function locally against your sample payload and a second, malformed one, to see how it handles bad input.

  5. Ask the agent to publish the function once it behaves as expected.

结果

A published coded function that normalizes an order payload, ready to be called from a Maestro service task, an agent, or a workflow.

后续步骤

Wire the function into the automation that needs it — for example, a Maestro Flow that calls it before routing the order for approval. See Coded functions.

备注:

The generated contract and file layout depend on your agent, your prompt, and whether you chose Python or TypeScript/JavaScript. Use the transform's correctness against your sample payloads, not the exact files, as your signal of success.

  • 先决条件
  • Build the function
  • 结果
  • 后续步骤

此页面有帮助吗?

连接

需要帮助? 支持

想要了解详细内容? UiPath Academy

有问题? UiPath 论坛

保持更新