Copied to clipboard

Flag this post as spam?

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


  • Daniel Rogers 134 posts 712 karma points
    Feb 07, 2020 @ 06:10
    Daniel Rogers
    0

    nested item name extracted from JSON value

    I have custom pluggin that returns a JToken as bellow.

    [{"Heading":{"Text":"Trade Center","Tag":"h1"},"SubHeading":{"Text":"","Tag":"h1"}}]

    the nested field aliase is "frameHeading"

    on the nested templae field i have {{frameHeading}}

    which returns an item name of [{"Heading":{"Text":"Trade Center","Tag":"h1"},"SubHeading":{"Text":"","Tag":"h1"}}]

    How do I decode this in the template field to "Trade Center"

  • Ryan Helmn 26 posts 188 karma points
    Feb 10, 2020 @ 14:20
    Ryan Helmn
    100
    [ 
       { 
          "Heading":{ 
             "Text":"Trade Center",
             "Tag":"h1"
          },
          "SubHeading":{ 
             "Text":"",
             "Tag":"h1"
          }
       }
    ]
    

    With it being an array of objects, it would have be something like the following: {{frameHeading[0].Heading.Text}}

  • Daniel Rogers 134 posts 712 karma points
    Feb 10, 2020 @ 14:43
    Daniel Rogers
    1

    Thanks Ryan. Solved

    That's so simple.

  • Ryan Helmn 26 posts 188 karma points
    Feb 10, 2020 @ 14:46
    Ryan Helmn
    0

    Glad I could help!

Please Sign in or register to post replies

Write your reply to:

Draft