Replace path in an object

Options

Hi, I am getting this info of a product (see below) from Meta catalog and named it "variant_json".

Now I need to do an external call sending "variant_json" as parameter but the path "name" should be changed to "title".

Will I have to create a new object variable from scratch (setting each path and value one by one) or is there a filter or some technique that allows me to send "variant_json" with path "name" replaced by "title"?


What I receive:

variant_json
: {name: Hoodie Unisex Blanco,retailer_id: 10759,availability: in stock,description: Camiseta sin mangas en tela licra poliéster con un logo estampado en transfer en el pecho. Tiene un cordón con puntera metálica.,image_url: https://imfitworld.com/wp-content/uploads/2022/11/HOODIE-BLANCO-1.jpg,price: $ 65,000,condition: new,url: https://imfitworld.com/,brand: Imfit World,retailer_product_group_id: product_default_group86926729755642310759,currency: COP,gender: ,age_group: ,id: 9163031817105590}

What I must send:

variant_json: {title: Hoodie Unisex Blanco,retailer_id: 10759,availability: in stock,description: Camiseta sin mangas en tela licra poliéster con un logo estampado en transfer en el pecho. Tiene un cordón con puntera metálica.,image_url: https://imfitworld.com/wp-content/uploads/2022/11/HOODIE-BLANCO-1.jpg,price: $ 65,000,condition: new,url: https://imfitworld.com/,brand: Imfit World,retailer_product_group_id: product_default_group86926729755642310759,currency: COP,gender: ,age_group: ,id: 9163031817105590}


Any help would be appreciated, thanks!

Tagged:

Best Answer