Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Mikkel Johansen 116 posts 292 karma points
    May 09, 2017 @ 20:20
    Mikkel Johansen
    0

    Grid api - how do I CRUD grid-content via ContentService

    Is there a grid api?

    Is it possible to create/update/delete content in a grid with ContentService?

  • Tom 713 posts 954 karma points
    May 20, 2019 @ 04:42
    Tom
    0

    Does anyone have an answer to this?

  • Søren Kottal 702 posts 4497 karma points MVP 5x c-trib
    May 20, 2019 @ 06:28
    Søren Kottal
    100

    There is no API, so you have to author the JSON yourself.

  • Tom 713 posts 954 karma points
    May 28, 2019 @ 06:55
    Tom
    0

    Thanks Soren, My main issue is if you say for example use contentservice to get a property value from a grid and then set that value on another property that is a grid datatype it mangles the json so you can't copy grid values from one property to another.

    Is there a way around this?

    eg if you use something like GetPropertyValue for a grid data type and then use that value to set it on another grid data type via IContent content.SetValue(..., ...)

    it won't set it correctly and the grid value is invalid.

  • Søren Kottal 702 posts 4497 karma points MVP 5x c-trib
    May 30, 2019 @ 12:49
    Søren Kottal
    0

    Hi Tom

    I have used the ContentService for populating grid values a few times, but never ran into problems where the json got mangled. Can you give an example of what happened, and what you expected?

  • Tom 713 posts 954 karma points
    May 30, 2019 @ 23:29
    Tom
    0

    enter image description here

    enter image description here

    I have some custom grid controls as well but I would think copying over json is copying over json.

  • Mario Lopez 168 posts 952 karma points MVP 3x c-trib
    May 31, 2019 @ 03:33
    Mario Lopez
    0

    Hey Tom, are you using V7 or V8? Because I just tested your code in V8 and it worked ok.

  • Tom 713 posts 954 karma points
    May 31, 2019 @ 06:56
    Tom
    0

    v7.8.1 at the moment

Please Sign in or register to post replies

Write your reply to:

Draft