Skip to main content
Answer

CSV format for ERD fields of Primary Key and Foreign Key

  • November 6, 2025
  • 2 replies
  • 31 views

Forum|alt.badge.img+1

Hi,

I’ve generated a csv file that appears to be in the right format to import database data into a Lucidchart ERD.

The import works, and I can display my ERD chart, and see the foreign key joins, but for fields in tables that are both Primary Keys and Foreign Keys, and I populate the constraintType column of my import csv file with:

"PRIMARY KEY, FOREIGN KEY"

the ERD chart only ever seems to show ‘FK’ in the Key column, and not ‘PK / FK’. I’ve tried widening the Key column just to check that the text hasn’t been truncated, but the column only seems to be populated with either FK or PK, and not PK / FK where the import file defines it.

 

Any help or suggestions gratefully received.

 

Paul

Best answer by Zuzia S

Hi ​@Paul.Gr, thank you for your post and thank you ​@aparrish for chiming in!

Lucid does support marking a field as both a Primary Key and a Foreign Key during import, but it requires the constraintType value in the CSV to be formatted correctly. In some cases, you may need to make small manual adjustments to the import data to ensure the PK/FK state shows properly.

If you’re still seeing only PK or FK, feel free to share a snippet of your CSV (with any sensitive info removed), and we can help identify what might need adjusting.

We’re very interested in your feedback and committed to continually improving our products. Please first search the Product Feedback section of this community (with the filter Topic Type = Idea) to see if it’s already been submitted. If so, please add any additional details you’d like and upvote the request - this consolidation helps to refine feedback and properly capture the popularity of the request.

If no one has submitted this idea yet, please create one of your own and be sure to include details about your use case or what you’d like to see in this experience. This will also allow other users with similar requests to discover and upvote it, then add details of their own.

Finally, for more information on how Lucid manages feedback via this community, take a look at this post:

Cheers!

Comments

aparrish
Lucid Legend Level 7
Forum|alt.badge.img+15
  • Lucid Legend Level 7
  • November 8, 2025

@Paul.Gr I found a related help article that might be able to help you with this.

https://help.lucid.co/hc/en-us/articles/16471565238292-Create-an-Entity-Relationship-Diagram-in-Lucidchart. If it doesn’t help, I suggest submitting a ticket to our Product Support team.


Zuzia S
Forum|alt.badge.img+8
  • Lucid community team
  • Answer
  • November 19, 2025

Hi ​@Paul.Gr, thank you for your post and thank you ​@aparrish for chiming in!

Lucid does support marking a field as both a Primary Key and a Foreign Key during import, but it requires the constraintType value in the CSV to be formatted correctly. In some cases, you may need to make small manual adjustments to the import data to ensure the PK/FK state shows properly.

If you’re still seeing only PK or FK, feel free to share a snippet of your CSV (with any sensitive info removed), and we can help identify what might need adjusting.

We’re very interested in your feedback and committed to continually improving our products. Please first search the Product Feedback section of this community (with the filter Topic Type = Idea) to see if it’s already been submitted. If so, please add any additional details you’d like and upvote the request - this consolidation helps to refine feedback and properly capture the popularity of the request.

If no one has submitted this idea yet, please create one of your own and be sure to include details about your use case or what you’d like to see in this experience. This will also allow other users with similar requests to discover and upvote it, then add details of their own.

Finally, for more information on how Lucid manages feedback via this community, take a look at this post:

Cheers!