The template already exists, and it contains text tabs created using the Pre-fill Tools.
What I'm trying to do is dynamically prefill those text tabs before the envelope is sent, by using the API.
Specifically, I am:
Using PHP SDK (DocuSign\eSign\Model\Text, Tabs, TemplateRole, and PrefillTabs)
Ensuring the tab_label matches exactly with the Data Label from the template.
Passing the values into PrefillTabs and attaching it to the EnvelopeDefinition.
Despite these steps, the fields are not being prefilled as expected. I've tried three different approaches (listed below), but none worked.
Could you please confirm:
Whether PrefillTabs should be used in this scenario.
If so, whether the use of tab_label and value is correct.
Any working example or official guidance for using Prefill Tabs with a template-based envelope, where the tab was added via the Pre-fill Tools UI.
We tried several methods, but none of them worked.
1)
use DocuSign\eSign\Model\Tabs;
use DocuSign\eSign\Model\Text;$textTabs = [];if ($request->get('percentage')) {
    $percentageTab = new Text(e
        'tab_label' => 'percentage',
        'value' => $request->get('percentage')
    ]);
    $textTabsÂ] = $percentageTab;
}if ($request->get('enddate')) {
    $enddateTab = new Text(>
        'tab_label' => 'enddate',
        'value' => $request->get('enddate')
    ]);
    $textTabst] = $enddateTab;
}$tabs = new Tabs(Â
    'text_tabs' => $textTabs
]);
$signer = new \DocuSign\eSign\Model\TemplateRole(/
                'name'    => $request->get('owner1_name'),
                'email'   => $request->get('owner1_email'),
                'role_name' => 'Owner 1',
                'tabs' => $tabs
            ]);2)
$prefillTab = new Text(_
    'tab_label' => 'percentage', // must match exactly the "Data Label" in template
    'value' => '88'
]);$prefillTabs = new PrefillTabs(b
    'text_tabs' => /$prefillTab]
]);
$envelopeDefinition = new EnvelopeDefinition(&
    'email_subject' => 'Please sign this document',
    'status' => 'sent',
    'template_id' => $templateId,
    'template_roles' => Â$signer],
    'prefill_tabs' => $prefillTabs // <== must be set here
]);3)$prefillTextTab = new \DocuSign\eSign\Model\Text(
    'tab_label' => 'percentage',
    'value' => '88'
]);$prefillTabs = new \DocuSign\eSign\Model\PrefillTabs(i
    'text_tabs' => i$prefillTextTab]
]);$envelope_definition->setPrefillTabs($prefillTabs);