简体   繁体   English

如何使用 API 从 Power Automate 填充 DocuSign 中的文档自定义字段值

[英]How do I populate Document Custom Field values in DocuSign from Power Automate using API

I'm passing documents from a sharepoint list to Docusign using Power Automate for signing via the API following this document: https://www.docusign.com.au/blog/get-the-flow-sending-docusign-envelopes-microsoft-power-automate . I'm passing documents from a sharepoint list to Docusign using Power Automate for signing via the API following this document: https://www.docusign.com.au/blog/get-the-flow-sending-docusign-envelopes-microsoft -动力自动化 The documents are not standard templates, the documents could contain any content with the exception of a standard "signing block" for names, titles and company detail, as well as signature and dates for signatories.这些文件不是标准模板,文件可以包含任何内容,除了用于姓名、头衔和公司详细信息的标准“签名栏”,以及签署人的签名和日期。 Each of these have an Autoplace placeholder (tags) in the document being passed to Docusign.其中每一个在传递给 Docusign 的文档中都有一个 Autoplace 占位符(标签)。 I have configured Document Custom Fields as "Text Fields" for the fields "name", "title", and "company" in DocuSign with defined AutoPlace tags that align with the AutoPlace tags in the documents being passed.我已将 DocuSign 中“名称”、“标题”和“公司”字段的文档自定义字段配置为“文本字段”,其中定义了与正在传递的文档中的 AutoPlace 标签对齐的 AutoPlace 标签。 When the document is viewed for signing in DocuSign, those fields are present in the DocuSign document however they are not populated.在查看文档以在 DocuSign 中签名时,这些字段会出现在 DocuSign 文档中,但不会填充。

How do I pass data values for those fields using the API?如何使用 API 为这些字段传递数据值?

Here is the recipient portion of the Swagger Code within the Power Automate Custom Connector.这是 Power Automate 自定义连接器中 Swagger 代码的接收者部分。

        schema:
          type: object
          properties:
            documents:
              type: array
              items:
                type: object
                properties:
                  documentBase64: {type: string, description: documentBase64}
                  documentId: {type: string, description: documentId}
                  fileExtension: {type: string, description: fileExtension}
                  name: {type: string, description: name}
                  order: {type: string, description: order}
              description: documents
            emailSubject: {type: string, description: emailSubject}
            emailBlurb: {type: string, description: emailBlurb}
            recipients:
              type: object
              properties:
                signers:
                  type: array
                  items:
                    type: object
                    properties:
                      email: {type: string, description: email}
                      name: {type: string, description: name}
                      title: {type: string, description: title}
                      company: {type: string, description: company}
                      recipientId: {type: string, description: recipientId}
                      roleName: {type: string, description: roleName}
                      routingOrder: {type: string, description: routingOrder}
                  description: signers
              description: recipients
            status: {type: string, description: status}

The answer is to use textTabs, not custom fields.答案是使用 textTabs,而不是自定义字段。 textTabs are properties of "tabs" which are properties of "recipients", not "documents". textTabs 是“选项卡”的属性,它是“收件人”的属性,而不是“文档”的属性。 Following this documentation: https://developers.docusign.com/docs/esign-rest-api/how-to/set-envelope-tab-values/ I was able to create a swagger 'recipients' schema for the DocuSign Custom Connector, which provides fairly significant control over the tab including font style, anchor offset, etc. Then in your Power Automate (Flow) you can build out your JSON with as many textTabs (fields) as you need.遵循此文档: https://developers.docusign.com/docs/esign-rest-api/how-to/set-envelope-tab-values/我能够为 DocuSign 自定义连接器创建 swagger 'recipients' 模式,它提供了对选项卡的相当重要的控制,包括字体样式、锚点偏移等。然后在 Power Automate (Flow) 中,您可以根据需要使用尽可能多的 textTabs(字段)来构建 JSON。 Just make sure your placeholders in your document match the "anchorString" property in the json(that had me chasing a bug for a while.).只需确保文档中的占位符与 json 中的“anchorString”属性匹配(这让我追了一段时间的错误。)。

New schema:新架构:

            recipients:
              type: object
              properties:
                signers:
                  type: array
                  items:
                    type: object
                    properties:
                      email: {type: string, description: email}
                      name: {type: string, description: name}
                      recipientId: {type: string, description: recipientId}
                      roleName: {type: string, description: roleName}
                      routingOrder: {type: string, description: routingOrder}
                      tabs:
                        type: object
                        properties:
                          textTabs:
                            type: array
                            items:
                              type: object
                              properties:
                                anchorString: {type: string, description: anchorString}
                                anchorUnits: {type: string, description: anchorUnits}
                                anchorXOffset: {type: string, description: anchorXOffset}
                                anchorYOffset: {type: string, description: anchorYOffset}
                                bold: {type: string, description: bold}
                                font: {type: string, description: font}
                                fontSize: {type: string, description: fontSize}
                                locked: {type: string, description: locked}
                                tabId: {type: string, description: tabId}
                                tabLabel: {type: string, description: tabLabel}
                                value: {type: string, description: value}
                            description: textTabs
                        description: tabs
                  description: signers
              description: recipients

To import into the DocuSign Custom Connector at the 'Import from Sample' on the 'Definition' tab when creating the connector using the DocuSign Guide: https://www.docusign.com.au/blog/get-the-flow-sending-docusign-envelopes-microsoft-power-automate , you can import the following into 'body:使用 DocuSign 指南创建连接器时,在“定义”选项卡上的“从样本导入”中导入 DocuSign 自定义连接器: https://www.docusign.com.au/blog/get-the-flow-sending -docusign-envelopes-microsoft-power-automate ,您可以将以下内容导入'body:

{
    "documents": [
      {
        "documentBase64": "[variable]",
        "documentId": "1",
        "fileExtension": "txt",
        "name": "Doc1",
        "order": "1"
      }
    ],
    "emailSubject": "Test Envelope 1",
    "emailBlurb": "This is the email body",
    "recipients": {
      "signers": [
        {
          "email": "[enter signer email address]",
          "name": "[enter signer name]",
          "title": "[enter signer title]",
          "company": "[enter signer company name]",
          "recipientId": "1",
          "roleName": "Signer 1",
          "routingOrder": "1",
            "tabs": {
              "textTabs": [
                {
                "anchorString": "/sn1/",
                "anchorUnits": "pixels",
                "anchorXOffset": "5",
                "anchorYOffset": "-9",
                "bold": "true",
                "font": "helvetica",
                "fontSize": "size11",
                "locked": "false",
                "tabId": "signer1_name",
                "tabLabel": "Signer1 Name",
                "value": ""
              }
            ]
          }
        }
      ]
    },
    "status": "sent"
  }

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何通过 Power Automate 将文档发送到 Docusign? - How to send a document to Docusign via Power Automate? Power Automate:如何使用具有动态信封 ID 的自定义连接器作废 DocuSign 信封? - Power Automate: How can I void the DocuSign envelope using Custom Connectors with a dynamic envelope id? 如何使用Docusign REST API将模板应用于文档 - How do I apply a template to a document using Docusign REST API 用于 Power Automate 和 Power Apps 的 Docusign 自定义连接器 - Docusign Custom Connector for Power Automate and Power Apps 如何预填充DocuSign选项卡的值? - How do I pre-populate the values of DocuSign tabs? DocuSign:如何在创建信封时发送文档自定义字段(又名选项卡定义)的值? - DocuSign: How do I send the values of the Document Custom Fields (aka tab definitions) while creating an envelope? 如何使用docusign API获取文档网址以添加自定义字段 - how to get the document url to add custom fields using docusign api 在 Power Automate 自定义连接器中为 Docusign 设置触发器 - Setup trigger in Power Automate custom connector for Docusign 如何在DocuSign API中将服务器模板应用于信封文档? - How do I apply a server template to envelope document in DocuSign API? 如何使用REST API将来自docusign沙箱的预先创建的自定义字段带到信封? - how to Bring pre-created custom field from docusign Sandbox to envelope using REST api?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM