Skip to main content
import requests

url = "https://data.lucid.app/adapter/csv?dataSource=https://data.lucid.app/dataSources/123456"

payload = {}
files=[
('file',('FILE.csv',open('FILE.csv','rb'),'text/csv'))
]
headers = {
'accept': 'application/json;v=1',
'Authorization': 'Bearer oauth2-xxxx'
}

response = requests.request("PUT", url, headers=headers, data=payload, files=files)

print(response.text)

I am using code like above to attempt to update an existing CSV datasource via API
https://lucid.readme.io/reference/updatedatasourcefromcsv

The request gets a successful 200 OK Response but the lastModified value never changes and the data does not update in the LucidChart that has that data linked in.

I tried adding the optional collection parameter but saw no difference in response or results.

Hello GaryZ,

I am reviewing your post now and will be in touch.


Hi GaryZ,

Update Data Source from CSV falls under our Legacy APIs that are not actively under development, and are more susceptible to errors. I've confirmed that there is a known issue with the lastModified field causing it to not update properly. The data source is being updated with the API call, however document data created from a CSV data source does not update with the source. You'll see that if you import data into a new document using the same source, it should have the updated data. Data imported via non-CSV sources does not have this limitation.

I've made a note of these issues, but can't guarantee they'll be fixed within a reasonable timeframe. My recommendation is to try either Google Sheets or Excel Online Beta as a data source. These will automatically update shapes on the document as new data is entered and doesn't require API calls to update the data source.


Hi GaryZ,

Update Data Source from CSV falls under our Legacy APIs that are not actively under development, and are more susceptible to errors. I've confirmed that there is a known issue with the lastModified field causing it to not update properly. The data source is being updated with the API call, however document data created from a CSV data source does not update with the source. You'll see that if you import data into a new document using the same source, it should have the updated data. Data imported via non-CSV sources does not have this limitation.

I've made a note of these issues, but can't guarantee they'll be fixed within a reasonable timeframe. My recommendation is to try either Google Sheets or Excel Online Beta as a data source. These will automatically update shapes on the document as new data is entered and doesn't require API calls to update the data source.

Thank you for the detailed response.

Unfortunately the Google Sheets and Excel Online solutions are not viable for business reasons.

I’m wondering if there is anything I can do with the “Update Data Source” endpoint https://lucid.readme.io/reference/updatedatasource
It looks like this is only useful for changing data source names and adapter types. I don’t see any documentation on the "adapterType": "DATA_API".


Hi ​@GaryZ , thanks for your response. We will look into this and get back to you when we have more information!


GaryZ,

I don’t see “Update Data Source” being useful here. “Update Data Source from CSV” is correctly updating the data source, but documents previously created using that data source won’t be updated. It might not be possible to completely automate this at the moment. The best solution I got using CSVs was to manually add the data source to existing documents again after the data source has been updated via the API.


Reply