cancel
Showing results for 
Search instead for 
Did you mean: 

How to export customer details on the basis of the email ids present in a CSV

Former Member
0 Kudos

Hi, my problem statement is - to fetch the uid and name on the basis of uids(A CSV which has a list of uids) that I input.
Now this can be done by following query:
"#% impex.setTargetFile( ""Customer.csv"" );" insert_update Customer;uid[unique=true];name; "#% impex.exportItemsFlexibleSearch( ""select {pk} from {Customer} where {uid} in ('testcustomer1@gmail.com','testhello1@gmail.com')"");"
The result in csv will be the following:
# uid;name
testcustomer1@gmail.com;Test1|Customer1
testhello1@gmail.com;Test|Hello

But, the issue is that for 2 uids its easy, for 600k customers if to fetch out of 1200k is tough. I have a CSV of email ids from which I wish to refer here so that the list can be used directly somehow instead of manually adding 600k customers.
Kindly provide a solution for the same.
Thanks in advance.

Accepted Solutions (0)

Answers (3)

Answers (3)

former_member483526
Participant
0 Kudos

600k email addresses in 'in' clause is not good idea, it may not work as in dependents on database engine. Other option could be to import all email addresses in another custom Type and then join this new Type with Customer Type.

Thanks!!

Former Member
0 Kudos

Hi ,

This can be done by groovy script please find the attached script and modify accordingly.Run this in HAC(localhost:9001/hac/console/scripting/ ) . check Generated user CSV file in hybris directory link text

VinayKumarS
Active Contributor
0 Kudos

For these kind of complex scenario's please do write a beanshell script. So that you can export this data better than an impex exporter.