Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trouble calling <Specialty> ToMany field into generateXml #529

Open
davidfchuck opened this issue Sep 18, 2023 · 1 comment
Open

Trouble calling <Specialty> ToMany field into generateXml #529

davidfchuck opened this issue Sep 18, 2023 · 1 comment

Comments

@davidfchuck
Copy link

davidfchuck commented Sep 18, 2023

INSERT SHORT DESCRIPTION EXPLAINING THE HIGH-LEVEL REASON FOR THE NEW ISSUE HERE.

Current behavior

I'm creating a custom XML to feed into a job board, per respective job board specs.
I'm using the generateRSS section of the generateXml.ts file to create this XML.
I'm 99% done... but I can't properly call the data that resides in the "name" field for the Picker: Specialty.
Here is the 'raw data' code from my REST API on one of the jobs, as example:
"specialties":{"total":1,"data":[{"id":2000111,"name":"Neurology"}]},
which is interesting... because a similar "Picker" Category looks different, like this:
"publishedCategory":{"id":2000018,"name":"Physician"}

Here is my URL call info: (after my swimlane/Corp Token)
search/JobOrder?query=(isOpen:1%20AND%20isDeleted:0)${getQuery(appConfig)}&fields=id,title,address(city,state,zip),employmentType,dateLastPublished,publicDescription,customText3,customText4,customText5,responseUser(id),specialties1&count=500&sort=-dateLastPublished&start=0`

And if I call using this in the Children section of "job"
{ name: 'specialty', text: job.specialties } ====> produces [object Object] in the XML.
{ name: 'specialty', text: job.specialties.name } ====> produces a crash, "undefined" name property

I've tried a million different options.
the index.d.ts file shows

export declare type ToMany = ToManyRef | T[];
export interface ToManyRef {
total: number;
data: T[];
}

I've been working with ChatGPT on many other customizations I've done to the site, with much success. But I can't get this one figured...

This website says "ToMany" fields are pulled through the API "unnested". http://bullhorn.github.io/rest-api-docs/#get-file

Expected behavior

I just want the specialty field to flow through to my XML, like all the other data is.

Steps to replicate behavior

  1. all I mentioned

Screenshots

Current

Expected
Category vs  Specialty format within the API
Field Map, Job 3
Category vs  Specialty field layout with Job in Bullhorn ATS

@davidfchuck
Copy link
Author

Screenshot specialties

here's the code with { name: 'specialty', text: job.specialties }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant