Baboo7 / strapi-plugin-import-export-entries

Import/Export data from and to your database in just few clicks.
175 stars 86 forks source link

[BUG] - export / import Errors #174

Open AdvithShetty opened 7 months ago

AdvithShetty commented 7 months ago

Describe the bug When i try to export / import csv i am enountering an error. I am using STRAPI VERSION v4.19.1

Import Error

image

Export Error

image

How do i fix this?

AidosMarcos commented 6 months ago

Also having this error (Cannot read properties of undefined (reading 'kind')) when importing csv file. Strapi version v4.20.0

Any solution yet?

AdvithShetty commented 6 months ago

@AidosMarcos Nope i tried but couldn't figure it out

hussain-mustafa990 commented 6 months ago

I am also facing this issue on Strapi v4.17.1 and strapi-plugin-import-export-entries v1.23.1

SimpleProgrammingAU commented 6 months ago

Same here.

I'm using a python script with a bit of ChatGPT assist to do line by line import from CSV where the first row contains the names of the data fields.

import csv
import requests
import json

# CSV file path
csv_file_path = "C:\\path-to.csv"

# API endpoint
api_endpoint = "http://localhost:1337/api/endpoints"

def send_post_request(data):
    """
    Sends a POST request to the API endpoint.
    """
    headers = {"Content-Type": "application/json"}
    response = requests.post(api_endpoint, data=json.dumps(data), headers=headers)
    return response

def process_csv_file(csv_file_path):
    """
    Processes each row in the CSV file and sends a POST request.
    """
    with open(csv_file_path, mode="r", encoding="utf-8") as file:
        csv_reader = csv.DictReader(file)
        for row in csv_reader:
            data_object = {"data": row}
            response = send_post_request(data_object)
            print(
                f"HTTP Status Code: {response.status_code}, Response: {response.text}"
            )

if __name__ == "__main__":
    process_csv_file(csv_file_path)
kevinvugts commented 6 months ago

You guys are using a deprecated format. CSV is deprecated and JSON v1 as well.

ZhaoKunLong commented 6 months ago

@kevinvugts Hello I got the same issue! Yeah, notice that the CSV format is deprecated. But is there an alternative way to export CSV?

SimpleProgrammingAU commented 6 months ago

You guys are using a deprecated format. CSV is deprecated and JSON v1 as well.

Considering there is demand for CSV import/export, why has it been removed?