# export-workdays.php Form GUID Fix


**Last Updated:** 2025-11-20

**Date:** 2025-11-15  
**Issue:** export-workdays.php was using incorrect form GUID (Pricing Inquiry Form instead of Tools Lead Collection Form)

## Problem Identified

**Incorrect Form GUID:** `c2022eda-c9b4-4010-a02d-d920852585b1` (Pricing Inquiry Form)  
**Correct Form GUID:** `a91b263c-7ca2-418b-b35c-9664c30e968b` (Tools Lead Collection Form)

**Why This Matters:**

- The Pricing Inquiry Form does NOT have `tool_type` and `calculation_data` fields
- The Tools Lead Collection Form HAS these fields (as hidden fields)
- export-workdays.php sends `tool_type` and `calculation_data`, so it must use the tools form

## Changes Made

### 1. Form GUID Updated

```php
// Before:
define('HUBSPOT_WORKDAYS_FORM_GUID', 'c2022eda-c9b4-4010-a02d-d920852585b1');

// After:
define('HUBSPOT_WORKDAYS_FORM_GUID', 'a91b263c-7ca2-418b-b35c-9664c30e968b'); // Tools Lead Collection Form
```

### 2. Fields Added to Match Tools Form Structure

Added missing fields that the tools form expects:

- `firstname` (hidden, empty)
- `lastname` (hidden, empty)
- `company` (hidden, empty)
- `sign_up_type__c` = "Tools Page"
- `content` = "Arbeitstage-Rechner"
- `hs_lead_status` = "NEW"
- `description` = Formatted calculation summary
- `partner__c` (optional, empty)

### 3. Description Field Format

Updated to match `collect-lead.php` pattern:

```
Tool: Arbeitstage-Rechner
Description: Arbeitstage-Berechnung
Zeitraum: [startDate] - [endDate]
Arbeitstage: [finalWorkdays]
Land: [country]
Region: [region]

[JSON calculation data]
```

## Verification Results

**Before Fix:**

- Form: Pricing Inquiry Form (c2022eda...)
- Missing: `tool_type`, `calculation_data` ❌

**After Fix:**

- Form: Tools Lead Collection Form (a91b263c...)
- All fields present: ✅
- Missing fields: 0 ✅

## Files Updated

1. ✅ `v2/api/export-workdays.php` - Form GUID and fields updated
2. ✅ `scripts/hubspot/property-mapping.php` - Form GUID updated
3. ✅ `docs/guides/HUBSPOT_FORM_FIELD_CONFIGURATION.md` - Documentation updated

## Impact

**Before:** export-workdays.php was sending fields that didn't exist in the form, causing data loss  
**After:** All fields match the form structure, ensuring complete data capture

## Related Forms

**Tools Lead Collection Form (a91b263c...)** is now used by:

- `collect-lead.php` ✅
- `export-workdays.php` ✅

Both endpoints share the same form and send compatible field structures.
