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

传统“集成”活动

插入 ServiceNow 记录

UiPath.ServiceNow.Activities.InsertRecord

“插入 ServiceNow 记录”活动使用 ServiceNow表格 - POST API 插入新记录对象。

After inserting the record, the activity outputs the status of the request (success/failure information) in a ResponseStatus object (ServiceNowStatus) that you can use in subsequent activities (e.g., conditional logic).

此活动还将返回新记录对象的sys_id值。例如,如果要插入 ServiceNow事件对象,则可以通过在对象向导中添加String变量来输出sys_id值(请参阅下面的示例)。

提示:

此活动包提供了三种不同的方法来插入记录:插入 ServiceNow 记录更新插入记录插入导入集记录“插入 ServiceNow 记录”和“更新或插入记录”活动使用 REST API 直接写入生产表。插入导入集记录活动使用 REST 导入集 API 写入导入集表,数据会从中转换为目标生产表。为避免将记录直接插入到生产表中,建议您使用“更新插入 ServiceNow 记录”活动插入新记录。有关详细信息(包括对导入集性能进行故障排除),请参阅 ServiceNow 文档中的导入集。要了解有关使用导入集的更多信息,请参阅 ServiceNow 文档中的网页服务导入集使用导入集导入数据

工作方式

以下步骤和消息序列图是活动从设计时(即活动依赖项和输入/输出属性)到运行时如何工作的示例。

  1. 完成设置步骤。
  2. “ServiceNow 作用域”活动添加到您的项目中。
  3. Add the Insert ServiceNow Record activity inside the ServiceNow Scope activity.
  4. Click the Configure button inside the Insert ServiceNow Record activity (this opens the Object Wizard).
  5. Select the Object you want to insert and add the fields (with values) you want to populate.
  6. “输出”属性创建并输入ResponseStatus变量。
    • 您的输入属性值将发送到“表格 - POST API”。

    • API 会将 ResponseStatus 值返回到您的输出属性变量。

在活动正文中

To enter your Insert ServiceNow Record property values, you must use the Object Wizard by clicking the Configure button.

要了解有关对象向导的更多信息,请参阅业务活动框架页面。

  • sys_id - The id of the ServiceNow record that gets created. Enter a String variable. The sys_id is auto-generated by ServiceNow when you insert your new record. To retrieve this value for use in other activities, create and enter a String variable in the object wizard (example shown below).

属性

备注:

如果您看不到所选对象的属性列表,即使选择了“添加多个字段”选项,您可能也没有足够的权限在 ServiceNow 中查看对象元数据和修改数据。有关更多详细信息,请参阅权限问题故障排除

高级

  • AdditionalFields - A DataRow that includes the columns and values that you want to insert. The column names must match the names as they appear in the ServiceNow database table for the selected object type.

常见

  • “显示名称”- 活动的显示名称。此字段仅支持 StringsString 变量。

其他

  • “私有”- 选中后将不再以“Verbose”级别记录变量和参数的值。

输出

  • ServiceNowStatus - The status of the request (success/failure information). Enter a ResponseStatus variable (UiPath.BAF.Models.ResponseStatus). The ResponseStatus object includes three properties that you can use in other activities.
    • Success - Boolean - Specifies whether the API request was successful.
    • ErrorCode - String - The response error if the API request is unsuccessful (Success=False).
    • Message - String - The error message.

示例

下图显示了活动依赖关系和输入/输出属性值的示例。

有关分步说明和示例,请参阅快速入门指南。

  • 工作方式
  • 在活动正文中
  • 属性
  • 高级
  • 常见
  • 其他
  • 输出
  • 示例

此页面有帮助吗?

连接

需要帮助? 支持

想要了解详细内容? UiPath Academy

有问题? UiPath 论坛

保持更新