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

传统“集成”活动

上次更新日期 2026年5月18日

执行 SOQL

UiPath.Salesforce.Activities.ExecuteSoql

Executes a Salesforce Object Query Language (SOQL) command in Salesforce and returns the query results in a DataTable. This activity only functions inside a Salesforce Application Scope activity.

属性

常见

  • “显示名称”- 活动的显示名称。

输入

  • SOQLCommand - The SOQL command that you want to run. This must be a valid SOQL command. This field supports only strings and String variables.

    备注:

    SOQL 定义了几个在查询中有效的转义序列,以便您可以在搜索文本中包含特殊字符。您可以对新行、回车符、制表符、引号等进行转义。SOQL 中使用的转义字符是反斜杠 ( \ ) 字符。您可以查看此处的官方 Salesforce 文档,了解更多信息。

    如果未对连接到 SOQL 命令中的每个搜索字符串进行转义,则当搜索字符串中存在这些特殊字符时,活动将引发 MALFORMED_QUERY 错误。 在连接之前,应按如下方式对每个搜索字符串进行转义:

    str_Company.Replace(“\”, “\”).Replace(“'“, “\'”).Replace(“”””, “\”””)

    例如 如果 SOQL 命令是

    "Select Id from Account where Name = '" + str_Company + "'"

    并且 str_Company is John's Pizza 未转义而传递,则返回 MALFORMED_QUERY 错误。 正确的 SOQL 命令为:

    "Select Id from Account where Name = '" + str_Company.Replace(“\”, “\”).Replace(“'“, “\'”).Replace(“”””, “\”””) + "'"

其他

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

输出

  • Result - The result of running the SOQL command in Salesforce, stored in a DataTable variable. This field supports only DataTable variables.
  • Salesforce 状态 - 操作完成后从 Salesforce 返回的状态,存储在 SalesforceStatus 变量中。 此字段仅支持 SalesforceStatus 变量。
  • 属性
  • 常见
  • 输入
  • 其他
  • 输出

此页面有帮助吗?

连接

需要帮助? 支持

想要了解详细内容? UiPath Academy

有问题? UiPath 论坛

保持更新