Convert String into CDT

Hi All,

 

I am getting the response from exec procedure like below:

[success:true,error:,parameters:[BOOKS_CURSOR:[quantity:23,author:Collectif,price:3.74,title:Peppa Pig: Fun at the Fair]; [quantity:7,author:Judith Simanovsky,price:4.99,title:Panda Goes to the Olympics]],result:]

 

But I need to save the values of BOOKS_CURSOR in Books CDT which has quantity, author,price & title fields. Can you please guide how can I do it?

 

Thanks

  Discussion posts and replies are publicly visible

Parents
  • try this, it will help you

    load(
    local!data: "[success:true,error:,parameters:[BOOKS_CURSOR:[quantity:23,author:Collectif,price:3.74,title:Peppa Pig: Fun at the Fair]; [quantity:7,author:Judith Simanovsky,price:4.99,title:Panda Goes to the Olympics]],result:]",
    local!quantity: extract(local!data, "quantity:", ",author"),
    local!author: extract(local!data, "author:", ",price"),
    local!price: extract(local!data, "price:", ",title"),
    local!title: extract(local!data, "title:", "]"),
    cast(
    typeof(
    {
    type!Books()
    }
    ),
    a!forEach(
    local!quantity,
    {
    quantity: local!quantity[fv!index],
    author: local!author[fv!index],
    price: local!price[fv!index],
    title: local!title[fv!index]
    }
    )
    )
    )
Reply
  • try this, it will help you

    load(
    local!data: "[success:true,error:,parameters:[BOOKS_CURSOR:[quantity:23,author:Collectif,price:3.74,title:Peppa Pig: Fun at the Fair]; [quantity:7,author:Judith Simanovsky,price:4.99,title:Panda Goes to the Olympics]],result:]",
    local!quantity: extract(local!data, "quantity:", ",author"),
    local!author: extract(local!data, "author:", ",price"),
    local!price: extract(local!data, "price:", ",title"),
    local!title: extract(local!data, "title:", "]"),
    cast(
    typeof(
    {
    type!Books()
    }
    ),
    a!forEach(
    local!quantity,
    {
    quantity: local!quantity[fv!index],
    author: local!author[fv!index],
    price: local!price[fv!index],
    title: local!title[fv!index]
    }
    )
    )
    )
Children