Skip to main content
Jun 11, 2025 5:24 AM UTC
Solved

How to generate an org chart in Lucid with API

 

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

Trevor JAnswer
Lucid product team
Jun 16, 2025 4:57 PM UTC

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
Lucid support team
Jun 11, 2025 4:34 PM UTC

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.

Translate
shuAuthor
Jun 12, 2025 10:16 PM UTC

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?

 

Translate
Trevor JAnswer
Lucid product team
Jun 16, 2025 4:57 PM UTC

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!

Translate
shuAuthor
Jun 17, 2025 7:11 AM UTC

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?

Translate
Lucid product team
Jun 17, 2025 4:35 PM UTC

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.

Translate
shuAuthor
Jun 18, 2025 3:03 AM UTC

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?

Translate
Lucid product team
Jun 18, 2025 4:05 PM UTC

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.

Translate