Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add items to form repeater from an Excel or CSV file #157

Open
ammimounir opened this issue Nov 28, 2021 · 3 comments
Open

Add items to form repeater from an Excel or CSV file #157

ammimounir opened this issue Nov 28, 2021 · 3 comments

Comments

@ammimounir
Copy link

ammimounir commented Nov 28, 2021

Hi there
Is it possible to add a feature where the user can import excel file items to a form repeater before submiting the form to database ?
Form repeater is kind of time consuming when it comes to large amount of data (which is my case all the time), in every form we need to input more than 500 rows which are already in a excel file.

Thank You

@StreetDog71
Copy link

You need to split that problem in two. First, gather the data from the CSV file in a javascript array. There are a lot of tutorials and articles on how to do that. Upload the file, read it, parse it, get the data into the array, map it to the repeater fields. Done.
After that you can feed that array into the repeater with the setList function.

Say your repeater has the ID my_repeater and your javascript array is named my_js_array.
This will get the javascript array into the repeater:

$('#my_repeater').setList(my_js_array);

@ammimounir
Copy link
Author

You need to split that problem in two. First, gather the data from the CSV file in a javascript array. There are a lot of tutorials and articles on how to do that. Upload the file, read it, parse it, get the data into the array, map it to the repeater fields. Done. After that you can feed that array into the repeater with the setList function.

Say your repeater has the ID my_repeater and your javascript array is named my_js_array. This will get the javascript array into the repeater:

$('#my_repeater').setList(my_js_array);

How come I didn't think of that !! Thank a lot mate for the tip that helped me a lot.

@mrsnax
Copy link

mrsnax commented Dec 4, 2022

See an example for uploading:

#81 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants