Ability to export data with contact related fields #6414

Closed
opened 2025-12-29 19:40:24 +01:00 by adam · 5 comments
Owner

Originally created by @sincomil on GitHub (Apr 27, 2022).

NetBox version

v3.2.1

Feature type

New functionality

Proposed functionality

Requesting an ability to export VMs and devices list with fields related to contacts,
for example,

all devices associated with "John Doe"
or all devices associated with "Contoso Org"

Use case

When exporting data or generating a reports, very often need to pass this report to managers so they able have had to interact with related contacts to do some related work.

Database changes

It should not require any changes to database because searching by "contact" field currently implemented already, so need only to represent that search results in exportable data.

External dependencies

None

Originally created by @sincomil on GitHub (Apr 27, 2022). ### NetBox version v3.2.1 ### Feature type New functionality ### Proposed functionality Requesting an ability to export VMs and devices list with fields related to contacts, for example, all devices associated with "John Doe" or all devices associated with "Contoso Org" ### Use case When exporting data or generating a reports, very often need to pass this report to managers so they able have had to interact with related contacts to do some related work. ### Database changes It should not require any changes to database because searching by "contact" field currently implemented already, so need only to represent that search results in exportable data. ### External dependencies None
adam added the type: featurestatus: under review labels 2025-12-29 19:40:24 +01:00
adam closed this issue 2025-12-29 19:40:24 +01:00
Author
Owner

@jeremystretch commented on GitHub (Apr 27, 2022):

It sounds like what you want is the ability to filter devices (and other objects) by the contacts associated with them, so that you can export the list of filtered objects. Is that accurate?

@jeremystretch commented on GitHub (Apr 27, 2022): It sounds like what you want is the ability to filter devices (and other objects) by the contacts associated with them, so that you can export the list of filtered objects. Is that accurate?
Author
Owner

@sincomil commented on GitHub (Apr 28, 2022):

@jeremystretch not exactly. filtering by contacts already present. but in exported data there is no column with contact or contact group. problem in that you can filter VMs by multiple contacts, and then export result in CSV, but there is no way to determine what row was owned by whom in that CSV.

@sincomil commented on GitHub (Apr 28, 2022): @[jeremystretch](https://github.com/jeremystretch) not exactly. filtering by contacts already present. but in exported data there is no column with contact or contact group. problem in that you can filter VMs by multiple contacts, and then export result in CSV, but there is no way to determine what row was owned by whom in that CSV.
Author
Owner

@kkthxbye-code commented on GitHub (Apr 29, 2022):

Contacts are included if I add the column to the table before exporting, is this not the case for you @sincomil?

However, I think there is another bug, as it exports the contacts column like this:
"<a href=""/tenancy/contacts/3/"">test</a>, <a href=""/tenancy/contacts/4/"">test2</a>"

I found another ManyToManyColumn (the sites column in the ASN table) and tried exporting there and it also exported as HTML links.

Is this a bug with ManyToManyColumn exports @jeremystretch ?

@kkthxbye-code commented on GitHub (Apr 29, 2022): Contacts are included if I add the column to the table before exporting, is this not the case for you @sincomil? However, I think there is another bug, as it exports the contacts column like this: `"<a href=""/tenancy/contacts/3/"">test</a>, <a href=""/tenancy/contacts/4/"">test2</a>"` I found another ManyToManyColumn (the sites column in the ASN table) and tried exporting there and it also exported as HTML links. Is this a bug with ManyToManyColumn exports @jeremystretch ?
Author
Owner

@jeremystretch commented on GitHub (May 6, 2022):

Is this a bug with ManyToManyColumn exports @jeremystretch ?

For our purposes I believe so, although whether it would be considered a bug upstream in django-tables2 I couldn't say. The root issue is that the field does not implement a value() method to return only plaintext data, so the HTML from linkify=True ends up getting passed through. I've raised #9313 to address this.

@sincomil I believe @kkthxbye-code's comment above satisfies your use case (irrespective of the related bug). Have you tried this?

@jeremystretch commented on GitHub (May 6, 2022): > Is this a bug with ManyToManyColumn exports @jeremystretch ? For our purposes I believe so, although whether it would be considered a bug upstream in django-tables2 I couldn't say. The root issue is that the field does not implement a `value()` method to return only plaintext data, so the HTML from `linkify=True` ends up getting passed through. I've raised #9313 to address this. @sincomil I believe @kkthxbye-code's comment above satisfies your use case (irrespective of the related bug). Have you tried this?
Author
Owner

@jeremystretch commented on GitHub (May 24, 2022):

Closing this out as I believe the issue has been addressed and there has been no further response.

@jeremystretch commented on GitHub (May 24, 2022): Closing this out as I believe the issue has been addressed and there has been no further response.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#6414