使用tabLabel填充现有草稿信封中的标签页

huangapple go评论62阅读模式
英文:

Populating Tabs In An Existing Draft Envelope With The tabLabel

问题

使用 tabLabels 在现有信封中映射数据到选项卡是否可能?如果不行,我只需指定 tabId 来指示应该使用哪个选项卡填充我的数据,或者是否有其他标识符我应该使用?

背景 - 在创建基于此过程的模板时,我一直在填充选项卡。所以,如果我要填充文本选项卡,我的 JSON 如下:

{
    "textTabs": [
        {
            "tabLabel": "text",
            "value": "Jabberwocky!"
        }
    ]
}

我将另一个表单构建服务的表单字段内容映射到我的DocuSign表单中的选项卡,并且由于可以根据 tabLabel 指定应该填充哪些选项卡,我已经将我的表单字段映射到了 tabLabels。在创建草稿信封时,这样做是有效的。

但是,我需要在我的草稿信封中填充来自单独表单的后续表单提交内容到更多的选项卡。我想要使用我现有的表单字段 > tabLabels 映射,但当我尝试使用Envelopes UpdateEnvelopeRecipientTabs(我不确定在这里需要使用哪个),DocuSign会向我的信封添加新选项卡,而不是将我的数据映射到现有的选项卡 🥲

据我所知,每次创建新信封时都会生成唯一的 tabIds。因此,使用 tabLabels 将会更容易,因为对于每个信封来说,它们始终是相同的。

英文:

Is it possible to map data to tabs in an existing envelope using tabLabels? If not, do I just need to specify the tabId to indicate which tab should be populated with my data or is there a different identifier that I should use?

Background - I've been populating tabs while creating envelopes with a template based on this process. So if I'm populating a text tab, my json looks like:

{
    "textTabs": [
        {
            "tabLabel": "text",
            "value": "Jabberwocky!"
        }
    ]
}

I'm mapping the contents of form fields from another form building service to the tabs in my DocuSign form and since I can specify which tabs should be populated based on the tabLabel, I've mapped my form fields to tabLabels. This works fine when creating a draft envelope.

But I need to populate more tabs in my draft envelope with the contents of subsequent form submissions from separate forms. I'd like to use my existing map of form fields > tabLabels but when I try with Envelopes Update or EnvelopeRecipientTabs (I'm not sure which I need to use here), DocuSign adds new tabs to my envelope, rather than mapping my data to the existing tabs 🥲

As far as I can tell, unique tabIds are generated each time a new envelope is created. So it'd be much easier to use tabLabels, which are always the same for each envelope.

答案1

得分: 1

以下是翻译好的部分:

在最后,我确实需要在更新草稿信封中的收件人文本、复选框和单选按钮选项卡时使用 tabIds

正如我提到的,在创建信封时填充选项卡时,我可以使用 tabLabel + value。在更新选项卡时,我可以使用 tabId + value

与其基于 tabIds 创建一个新映射,我可以获取草稿信封的收件人选项卡,然后将它们与我现有的映射中的键匹配,基于选项卡的 tabLabel,这个标签在创建草稿信封后保持不变。

示例


文本或复选框选项卡

在创建信封时:

newTab = [
    'tabLabel': label,
    'value': tabValue
]

在更新草稿信封的收件人选项卡时:

newTab = [
    'tabId': tabId,
    'value': tabValue
]

单选按钮选项卡

在创建信封时:

radioButton = [
    'selected': true,
    'value': value
]

在更新草稿信封的收件人选项卡时:

radioButton = [
    'selected': true,
    'tabId': tabId
]

显然,单选按钮选项卡需要放在一个组中,如下所示:

newTab = [
    'groupName': groupName,
    'radios': [radioButton]
]
英文:

In the end I did have to use tabIds when updating recipient text, checkbox and radio tabs in a draft envelope but that's it.

As I mentioned, when populating tabs while creating an envelope I can use the tabLabel + value. When updating tabs, I can use the tabId + value.

Rather than creating a new map based on tabIds, I was able to fetch the draft envelope's recipient tabs and match them with the keys in my existing map, based on the tab's tabLabel, which remained the same after the draft envelope was created.

Examples


Text or checkbox tabs

During envelope creation:

newTab = [
    'tabLabel': label,
    'value': tabValue
]

Updating recipient tabs for a draft envelope:

newTab = [
    'tabId': tabId,
    'value': tabValue
]

Radio button tabs

During envelope creation:

radioButton = [
    'selected': true,
    'value': value
]

Updating recipient tabs for a draft envelope:

radioButton = [
    'selected': true,
    'tabId': tabId
]

Obviously radio button tabs need to be put in a group like

newTab = [
    'groupName': groupName,
    'radios': [radioButton]
]

答案2

得分: 0

你应该像你提到的那样使用EnvelopeRecipientTabs。这意味着你需要具体接收者的recipientId,该标签与每个接收者相关联。

所以,你可以构建一个像这样的URL:

PUT restapi/v2.1/accounts/{ACCOUNT_ID}/envelopes/{ENVELOPE_ID}/recipients/{RECIPIENT_ID}/tabs

现在,在请求的主体中,你需要具有以下字段:

documentId, recipientId, tabLabel, tabId, value

tabId是一个唯一的GUID,你可以在检查信封时找到它(你可以对信封进行GET操作并包括标签)。

tabLabel也必须匹配。

英文:

You should use EnvelopeRecipientTabs like you mentioned.
Which means you need to have the recipientId for the specific recipient that the tab is associated with (every tab is part of a specific recipient).

So you build a URL like this:

PUT restapi/v2.1/accounts/{ACCOUNT_ID}/envelopes/{ENVELOPE_ID}/recipients/{RECIPIENT_ID}/tabs

Now in the body of the request you need to have the following fields:

documentId, recipientId, tabLabel, tabId, value

tabId is a unique GUID that you can find if you check your envelope (you can make a GET to the envelope and include tabs)

tabLabel must also match

huangapple
  • 本文由 发表于 2023年2月14日 06:48:51
  • 转载请务必保留本文链接:https://go.coder-hub.com/75441907.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定