Skip to content

Commit 80f1279

Browse files
waleedlatif1claude
andcommitted
fix(peopledatalabs): isolate company name UI from person ops
Rename Company Name subBlock id from `name` to `company_name` so a stale company value can't leak into Person Enrich/Identify when the user switches operations. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
1 parent 9483249 commit 80f1279

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

apps/sim/blocks/blocks/peopledatalabs.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ export const PeopleDataLabsBlock: BlockConfig<PdlPersonEnrichResponse> = {
152152

153153
// Company Enrich fields
154154
{
155-
id: 'name',
155+
id: 'company_name',
156156
title: 'Company Name',
157157
type: 'short-input',
158158
placeholder: 'Acme Inc',
@@ -433,28 +433,31 @@ export const PeopleDataLabsBlock: BlockConfig<PdlPersonEnrichResponse> = {
433433
result.school_profile = undefined
434434

435435
// Clear shared target fields and repopulate them per-operation. The raw
436-
// `profile`/`location`/`name`/`website` subBlocks are scoped to specific
436+
// `profile`/`location`/`website` subBlocks are scoped to specific
437437
// operations in the UI, but their values persist when the user switches
438438
// operations — without this reset, e.g. a person LinkedIn URL would
439439
// leak into a Company Enrich request as the company profile.
440440
result.profile = undefined
441441
result.location = undefined
442442
result.name = undefined
443443
result.website = undefined
444+
result.company_name = undefined
444445

445446
if (op === 'pdl_person_enrich' || op === 'pdl_person_identify') {
446447
if (params.profile !== undefined) result.profile = params.profile
447448
if (params.location !== undefined) result.location = params.location
448449
if (params.name !== undefined) result.name = params.name
449450
}
450451
if (op === 'pdl_company_enrich') {
451-
if (params.name !== undefined) result.name = params.name
452+
if (params.company_name !== undefined) result.name = params.company_name
453+
else if (params.name !== undefined) result.name = params.name
452454
if (params.website !== undefined) result.website = params.website
453455
if (params.company_profile !== undefined) result.profile = params.company_profile
454456
if (params.company_location !== undefined) result.location = params.company_location
455457
}
456458
if (op === 'pdl_clean_company') {
457-
if (params.name !== undefined) result.name = params.name
459+
if (params.company_name !== undefined) result.name = params.company_name
460+
else if (params.name !== undefined) result.name = params.name
458461
if (params.website !== undefined) result.website = params.website
459462
if (params.company_profile !== undefined) result.profile = params.company_profile
460463
}

0 commit comments

Comments
 (0)