Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How do I import multiple object references into a single field?

Austin Jennings
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
February 22, 2023

I have several Insight objects set up, and I’m trying to import my data into them. One is called “Environments” and another is called “Nodes”. An environment can be associated with multiple nodes, so I created a multiple select field which references nodes. I can add them manually without issue. However, when I try to import them from a CSV, it doesn’t add the node values to environments. 

Here’s the CSV format:

Environment Name, Designator

Abc environment, node 1||node 2||node 3

 

And here’s my IQL statement:

Designator = ${Designator}

 

Based on another answer to a very similar sounding problem, I also tried the following:

Department IN (${Department${0}})

And that successfully imported one node for each environment, but not all of them. I tried removing the ${0} and that just brought me back to no nodes at all. 

If I change the field type I’m importing this into to a simple select field (not an object reference) this import works flawlessly. But, I need it to be a reference. 

For even more context, I have another object “POC” which also references my “Node” object, but it’s a 1:1 relationship. I was able to execute an import with no issues there. It seems to only be when I’m trying to import multiple object references to a single field. 

4 answers

2 votes
Richard Jenkins
Contributor
February 16, 2024

For multiple references, use double pipes "||" as the concatenation character in the CSV file. Then, when you set up the import and edit the mapping, use the same double pipes in the Concatenator column.

triumph.png

Keep in mind, that the column "Data Source Field" is for the headers in the CSV file and it is the value referenced in the AQL along with the object attribute:

<object attribute> IN (${<data source field>})

Here is the associated csv file:

object.png

So, in essence, if you need to have multiple entries into an object that can hold more than 1 object, then make sure that the column for that single object has all the selections separated by the double pipe "||".

0 votes
David May 16, 2024

I'm trying something similar without success.

I'm importing multiple disk to servers.

The problem is There are hundreds of disks wih the same name (C: or /) and it imports all of this per host.

How do I tell to use the VM name to filter the disk each server has?

Richard Jenkins
Contributor
May 16, 2024

Hello @John Doe . Can you send a screenshot to verify your issue? With that being said, it sounds like your identifier is using the wrong attribute. Go and check your import settings for this object by going into schema configuration > import > edit mapping > edit attributes mapping. Look for the attribute with a check box in the identifier column

2024-05-16_07-29-03.png

In my pic example, all items with a unique 'key' attribute will be separated into a unique object (record). If I changed it to Address, then all unique addresses will be a unique object when I import the objects. Hope this helps!

David May 16, 2024

I've solved the multiple disks issue changing "Cardinality" to "Unlimited".

But now I have another issue.

I have an object type called Virtual Guest (it scans VM from ESXi hosts). As Discovery lacks to get disks information from VMWare i have to add it manually from a .CSV file.

So I've created an object type called "Disk", with all the info I need, like:

  • VM: Hostname
  • Name: C:\
  • Size: 20000
  • Used: 10000
  • Available: 10000

But now, I want the disks reference to the Virtual Guest so when I go to a Virtual Guest machine and i see all the information for a specific machine:

  • Hostname: Server
  • IP Adddress: 1.1.1.1
  • RAM: 16Gb
  • Users: jdoe
  • Groups: administrator, user, printers...
  • Applications: whatever
  • ...
  • Disk (object type i've created), here it should reference to al the disks that are in "Disk" object type, like: C:\ D:\ E:\ 
David May 17, 2024

Got it with reverse reference from disk object type.

0 votes
Richard Jenkins
Contributor
February 16, 2024

Looking for this answer as well. I, too, am running into the same issue where it is not adding the additional references. I only get the first one.

0 votes
Ulrich Kamp February 22, 2023

It works for me exactly with your import phrase.

But I once had the same problem: Then I forgot to change the destination attribute (the first "Department" in your case) with Cardinality type to "Unlimited" (screenshot only in German).

unlimited.png

Austin Jennings
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
February 22, 2023

Thanks for the tip, unfortunately I had already checked “unlimited” so that’s not it either :/

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events