Data in DB when using repeater

I have 4 fields, Id #, Color, Team, Date, I am using the repeater field to make some things easier on my end. One issue is that the content of the field gets written to the database like this “a:1:{i:1;a:5:{i:44;a:1:{i:0;s:7:“2939092”;}i:73;a:1:{i:0;s:10:“neon green”;}i:75;a:1:{i:0;s:7:“Seahawk”;}i:79;a:1:{i:0;s:9:“2-22-2025”;}i:131;a:0:{}}}”

When I am trying to show this result in a spreadsheet, it makes no sense that way. I would need it either to have the 4 fields separated like “2939092, Neon Green, Seahawk, 2-22-2025” or to each be in its own meta key in the DB so it would come under its own column.

Is there any way to change how form submissions get written to the database?

Much appreciated for any assistance.

Hi Ryan. There’s no easy way to change how the repeater data is stored in the database. You will need to unserialize the data when you retrieve it from the database, before opening it in the spreadsheet.

An alternate method where the data may be more useful to you is with the Nested Forms Perk from Gravity Wiz: Gravity Forms Nested Forms | Gravity Forms Repeater Add-on | Gravity Wiz

Does this also apply to “list” fields? Is there any way to adjust the formatting of those? It would seem that since the entries show correctly in the backend that there should be some way to descramble the garbled mess.

You might want to look into Gravity Forms WPDB plugin

If you can create your own table and columns via PHPmyAdmin you can then use this plugin to map the forms data for each field to the corresponding column.

A quick look on their site and under supported fields, neither repeater or lists are there, so i dont think it will work.

I have gotten it partially cleaned up using a real-time search replace that runs when the page loads instead of trying to rework the database entries.

Would still like some kind of documentation on why/how gravity writes and decodes the db entries the way it does for lists/repeater fields.

1 Like

You could reach out and ask them. But if you are already heavily invested in creating your own solution then that’s understandable why you wouldn’t want to re-work it.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.