Handle Image from JSON

Post Reply
administrator
Site Admin
Posts: 82
Joined: Mon Dec 03, 2018 10:35 am

Handle Image from JSON

Post by administrator » Tue Jan 30, 2024 12:03 pm

var Products = record.fields.Foto;

// Check if the 'Products' field contains PNG base64 data
if (Products.indexOf("data:image/png;base64,") !== -1) {
// Remove the PNG base64 prefix
Products = Products.replace("data:image/png;base64,", "");
}

// Check if the 'Products' field contains JPEG base64 data
if (Products.indexOf("data:image/jpeg;base64,") !== -1) {
// Remove the JPEG base64 prefix
Products = Products.replace("data:image/jpeg;base64,", "");
}

// Set the modified value to the 'Producten' field (assuming this is the correct field name)
Producten = Products;

Post Reply

Who is online

Users browsing this forum: No registered users and 12 guests