How to unserialize datas?

Hello :wave:,

We have few column which has serialized datas. Is it possible to convert them to JSON for example ? Or explode these datas in few new columns ?

Thanks for your help.

Please post diagnostic info and the data as well so we can see what you're referring to

Hello,

Thanks for your reply.

We have these info in database and we want to extract datas from them :wave:

a: 6: {
i: 45;a: 7: {
s: 7: "Heading";s: 11: "Nom Prénom";s: 8: "optionId";s: 2: "45";s: 11: "attributeId";N;s: 14: "AttributeValue";s: 13: "Pascal Martin";s: 14: "AttributeLabel";s: 13: "Pascal Martin";s: 13: "attributeType";s: 4: "text";s: 12: "options_type";s: 4: "text";
}
i: 47;a: 7: {
s: 7: "Heading";s: 4: "Tél";s: 8: "optionId";s: 2: "47";s: 11: "attributeId";N;s: 14: "AttributeValue";s: 10: "0633220055";s: 14: "AttributeLabel";s: 10: "0633220055";s: 13: "attributeType";s: 4: "text";s: 12: "options_type";s: 4: "text";
}
i: 49;a: 7: {
s: 7: "Heading";s: 104: "Décrivez nous votre besoin (format, matière...) , nous vous contacterons en cas d'éléments manquants";s: 8: "optionId";s: 2: "49";s: 11: "attributeId";N;s: 14: "AttributeValue";s: 213: "Brochure assemblée piquage point métal 12 pages (2 points) Format fini : 148.5 x 210 mm - format à la française Papier : 80 g/m2 - Offset standard Impression : Recto : quadrichromie - Verso : quadrichromie";s: 14: "AttributeLabel";s: 213: "Brochure assemblée piquage point métal 12 pages (2 points) Format fini : 148.5 x 210 mm - format à la française Papier : 80 g/m2 - Offset standard Impression : Recto : quadrichromie - Verso : quadrichromie";s: 13: "attributeType";s: 4: "area";s: 12: "options_type";s: 4: "area";
}
i: 51;a: 7: {
s: 7: "Heading";s: 19: "Bon à tirer requis";s: 8: "optionId";s: 2: "51";s: 11: "attributeId";s: 16: "Numérique (PDF)";s: 14: "AttributeValue";s: 16: "Numérique (PDF)";s: 14: "AttributeLabel";s: 16: "Numérique (PDF)";s: 13: "attributeType";s: 5: "radio";s: 12: "options_type";s: 5: "radio";
}
i: 55;a: 7: {
s: 7: "Heading";s: 22: "Bon a délivrer requis";s: 8: "optionId";s: 2: "55";s: 11: "attributeId";s: 3: "Non";s: 14: "AttributeValue";s: 3: "Non";s: 14: "AttributeLabel";s: 3: "Non";s: 13: "attributeType";s: 5: "radio";s: 12: "options_type";s: 5: "radio";
}
s: 10: "Fichier_50";a: 6: {
s: 14: "AttributeValue";s: 16: "broch2564155.pdf";s: 14: "AttributeLabel";s: 16: "broch2564155.pdf";s: 8: "optionId";s: 2: "50";s: 13: "attributeType";s: 4: "file";s: 7: "Heading";s: 7: "Fichier";s: 11: "attributeId";s: 0: "";
}
}

You should be able to use the JSON unfolding features we introduced in the recent versions. Please upgrade to the latest version and check it out (it's only on select databases, not all)

Thanks.

Are you talking about this setting ?
image

We use MARIADB database and the latest version 0.45.2.1.

exactly, but you're seeing Implement json unfolding for MariaDB · Issue #25635 · metabase/metabase · GitHub

1 Like