Chained Select big CSV

Hi,

When I upload the small size CSV file(22kb) in the Chained Select. The update option work and form update but when I upload the small size CSV file(228kb) in the Chained Select. Then the update option doesn’t work and form update.

Thanks

Please see if you are running into either of these limitations:

Sir thanks for reply.

Limitations

By default the CSV file being uploaded is limited to 5000 unique values allowed for each column and 1mb of file size. If you require going beyond these limits your can alter them using gform_chainedselects_column_unique_values_limit and gform_chainedselects_max_file_size respectively.

How to increase the limit for the big CVS file?

When you’ll upload the big CVS file. Then you’ll click on the update button. The error will show on browser.

404 Page Not Found

Thanks

In the docs linked in the ‘Limitations’ you copy/pasted there are example code-blocks that can help you get the results you want.

If you’re not getting the needed results: could you please elaborate on what you’ve tried, what you expected it to do and what results you got instead? Thanks.

I pasted the code-blocks on the functions.php file. Then, I uploaded the CVS file on the chainedselects but the error is displaying.

Error Message

There was an error processing this file.
Error: 422, Message: One of your columns has exceeded the limit for unique values.

Then, I changed this code

add_filter( 'gform_chainedselects_column_unique_values_limit' , 'set_limit' );
function set_limit( $limit ) {
return 100;
}

To

add_filter( ‘gform_chainedselects_column_unique_values_limit’, ‘set_limit’ );
function set_limit( $limit) {
return 5000;
}

The error removed by the changed new code and Now the new error is displaying after to update form.

Error:

There was an error while saving your form. Please [contact our support team]

Did you change the gform_chainedselects_max_file_size too?

Don’t forget about the max_upload_filesize btw. If the file you’re trying to upload is larger than your hostingprovider has set as default, uploading larger files will result in errors.

Yes! I pasted the code for max file size.

add_filter( 'gform_chainedselects_max_file_size' , 'set_size' );
function set_size( $size ) {
return 2000000; //2mb
}

Now I’ve changed the max upload file size( php_value upload_max_filesize 30M and 512M) according to your requirements.

The error is still displaying after to update form.

Error:

There was an error while saving your form. Please [contact our support team]

You’re probably running into a $_POST size limit since all of that data is being loaded into the form.

You will have much better results if you create a new table in your WordPress installation, import your CSV there, and then use the gform_chained_selects_input_choices filter to query your custom table and fetch the desired rows.

2 Likes