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

Import related entities (api-chain) #17

Open
sluc23 opened this issue Nov 19, 2018 · 4 comments
Open

Import related entities (api-chain) #17

sluc23 opened this issue Nov 19, 2018 · 4 comments

Comments

@sluc23
Copy link
Contributor

sluc23 commented Nov 19, 2018

@eileenmcnaughton Just asking before diving into the source code.
Is there a way a related entity to the main one could be imported in the same process? Like Contact.Email, within a Contact csv file, for example?
My guess is not , because the mapping doesn't show related entities to be selected.

So if it's not the case, do you think it is possible / worth it to add the feature to import related entities using api-chain? I could try to implement that if it's feasible.

@eileenmcnaughton
Copy link
Owner

@sluc23 1e5a9eb was an attempt by Compucorp to add some degree of related entity support- I haven't checked it out carefully though

@sluc23
Copy link
Contributor Author

sluc23 commented Nov 20, 2018

tx!. I'll take a look.
I've found this extension super-powerful for allowing import "~ large" datasets avoiding web timeouts (which I think at one point this implementation of using queues for import must be implemented in core).
But a Contact with email, address, phone and web site i.e. needs to be in imported in 4 separated processes.

I'll give a try if I can sort it out the api chain import in one csv file :)

@eileenmcnaughton
Copy link
Owner

It would be interesting to see if @colemanw has any idea about how we could make the metadata allow you to start from contact & find other entities (in api v4 I guess but we could update this easily to apiv4) - currently you can discover contact from email but not vice versa

@sluc23
Copy link
Contributor Author

sluc23 commented Nov 21, 2018

@eileenmcnaughton you right, my first impression is that the only way to "link" related entities from the parent Entity, is hardcoding who are the children per Entity.

I don't see a way to discover them using api3, for instance in Contact there's no way using api3 to discover that Email, Phone, Address, etc.. could be created using 1-level api-chain.
getfields() api method return a parameter called FKApiName which looks like the candidate to use, but it's only set in Contact fields primary_contact_id and current_employer_id

So do you think at this point makes more sense to start thinking on a migration to api4 than keep on adding exceptions or complex code to get this work on api3 ?

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

2 participants