Skip to main content
Answer

How to generate an org chart in Lucid with API

  • June 11, 2025
  • 7 replies
  • 140 views

Forum|alt.badge.img+4

 

When I ran the sample code below, a blank page was generated.

The sample data named org-chart-data.csv has already been stored in the data link.

Is it possible to create an organizational chart document from the organizational chart data via the API?

I apologize for the inconvenience, but I would greatly appreciate it if you could check this.

--------------------------------------------------------------------------------------------------------------------------------------------

sample-lucid-rest-applications/standard-import/demo-files/org-chart/unzipped-contents at main · lucidsoftware/sample-lucid-rest-applications · GitHub

{
  "version": 1,
  "product": "lucidchart",
  "pages": [
    {
      "id": "page1",
      "title": "Org Chart Example",
      "dataBackedShapes": [
        {
          "id": "orgChart1",
          "type": "orgChart",
          "position": {
            "x": 150,
            "y": 150
          },
          "collectionId": "org-chart-data",
          "idField": "Employee ID",
          "foreignKeyField": "Supervisor ID",
          "nameField": "Full Name",
          "roleField": "Role",
          "imageUrlField": "Image",
          "extraFields": [
            "Email",
            "Cell Phone",
            "Building"
          ]
        }
      ]
    }
  ],
  "collections": [
    {
      "id": "org-chart-data",
      "dataSource": "org-chart-data.csv"
    }
  ]
}


 

response

https://lucid.app/lucidchart/ab7edbd2-ddef-4ee3-b2f3-1e0843a99175/view

Best answer by Trevor J

Hi Shu,

Yes, you can create Japanese organizational charts through the API, as long as you correctly assign the names of the columns to the correct field in the document.json file. For example “roleField”: ”役職”. Let us know if you run into any trouble!

Comments

Richard Udell
Forum|alt.badge.img+8
  • Lucid support team
  • June 11, 2025

Hi ​@shu , thank you for contributing to the Lucid for Developers Community. This can happen because the request isn't formatted correctly. For generating a document from a data source, you need to use our Standard Import process, which requires packaging your files together first.

A quick note on your comment about the CSV being in a "data link": For the Standard Import process to work, the dataSource field in your JSON ("dataSource": "org-chart-data.csv") must refer to a file that is included inside the .lucid package. Our API is not accessing data sources that are already linked in your Lucid account in the product UI.

Let me know if you have any further questions and I’ll do my best to help.


Forum|alt.badge.img+4
  • Author
  • June 12, 2025

Thanks to you, it has been successfully resolved.

I have one more question: Is it possible to create a Japanese version of the organizational chart, system architecture diagram, etc., through the API?

 


Forum|alt.badge.img+3
  • Lucid product team
  • Answer
  • June 16, 2025

Hi Shu,

Yes, you can create Japanese organizational charts through the API, as long as you correctly assign the names of the columns to the correct field in the document.json file. For example “roleField”: ”役職”. Let us know if you run into any trouble!


Forum|alt.badge.img+4
  • Author
  • June 17, 2025

Hi Shu,

Yes, you can create Japanese organizational charts through the API, as long as you correctly assign the names of the columns to the correct field in the document.json file. For example “roleField”: ”役職”. Let us know if you run into any trouble!

 

this is a new question.

I generated an organizational chart through the standard import function via the API, but it only included names and positions.

Is there a way to output all headers from the CSV, such as names, positions, department names, and notes, all at once via the API? How should the document.json file be defined?


Forum|alt.badge.img+3
  • Lucid product team
  • June 17, 2025

There is an example on the documentation page for Data Backed Shapes for how to define the document.json file. You can include additional headers under the extraFields value.

Once the Lucid document has been created, you can edit which fields are displayed by selecting the org chart and opening the right-side panel.


Forum|alt.badge.img+4
  • Author
  • June 18, 2025

I want to expand all the items of a Lucid document created via the API, and then export the fully expanded Lucid document as an image through the API. Therefore, is there a way to expand all the items of the Lucid document without doing it manually?


Forum|alt.badge.img+3
  • Lucid product team
  • June 18, 2025

Unfortunately, there’s currently no way to display all fields without doing it manually. I agree that this is not ideal. I will report this to our team to see if we can add this functionality.