csv import and links between objects
Asked by Heiko Lotz:

I need help with importing csv files and linking objects.

I have two csv files: customers and (as a child of customers) employees of the customer:

Customer object Attributes:  
Name (type standard, text), customer number (type standard, integer)  

Employee object Attributes:  
Employee name (type standard, text), CustomerNo (type standard, integer), Ref customer (type object, object customer, reference)

The customers were all imported via csv. When importing the employees, a link should now be created between the customers and the employees via the customer number (Customer) / CustomerNo (Employee).

I have mapped the fields when importing the employees via csv:

csv.name \> employee name  
csv.customer number \> CustomerNo  
csv.customer \> Ref customer (AQL: CustomerNo ={CustomerNumber})

How can I ensure that the Ref customer field is linked to the customer during the import? I allready tried several AQL-statements but had no luck.: CustomerNo = CustomerNumber, CustomerNo = ${CustomerNumber}

I would be delighted to receive a tip.


Answers:
author: Christopher Yen
body: Hi [@Heiko Lotz](/t5/user/viewprofilepage/user-id/5380527)

I think the AQL might be this if I'm understanding your screenshots correctly

```
"customer number" =?${CustomerNumber}
```

comments: author: Heiko Lotz
body: Thank you so much! Made me very happy!


author: Alex Koxaras _Relational_
body: Hi [@Heiko Lotz](/t5/user/viewprofilepage/user-id/5380527) and welcome to the community,

While using the AQL to bind objects you have to keep this in mind. E.g. you have this AQL:

CustomerNo =${CustomerNumber}

**CustomerNo** should be the insight attribute and

**CustomerNumber** should be the column name of your csv.

That would be the case for 1-to-1 mapping. Make the corrections and try again. Let me know how it went.

comments: author: Heiko Lotz
body: Hello an thank you !!!

Now I am totaly confused. This is what it looks like:  

**ATTRIBUTES OBJECT CUSTOMER**

<br />

![pic01.png](https://community.atlassian.com/t5/image/serverpage/image-id/337358i0050D9F1748BF47E/image-size/large?v=v2&px=999 "pic01.png")

<br />

**ATTRIBUTES OBJECT EMPLOYEE**

![pic02.png](https://community.atlassian.com/t5/image/serverpage/image-id/337359i6BE9DB8D57C1D3F8/image-size/large?v=v2&px=999 "pic02.png")

<br />

**IMPORT-MAPPING**

![pic03.png](https://community.atlassian.com/t5/image/serverpage/image-id/337360i56031510A2C44171/image-size/large?v=v2&px=999 "pic03.png")

<br />

**employees.csv**

Name; CustomerNumber  
Anton A;10001;  
Berta B;10002;  
Caesar C;10002;  
Daniel D;10003;  
Emil E;10001;  
Fridolin F;10002;  
Gerda G;10004;


author: Heiko Lotz
body: It is still not working. Dont know how to link the objects.


author: Alex Koxaras _Relational_
body: Hi [@Heiko Lotz](/t5/user/viewprofilepage/user-id/5380527) try "customer number" = ${CustomerNumber}, that is the attribute "customer number" contains numbers just like the csv (e.g. 10001, 10002 etc).


author: Heiko Lotz
body: You are totally right! That is the solution!

Thank you so much :-) You made my dax.


Tags: cloud

jira-service-management

jira-service-management-cloud