Cloudron makes it easy to run web apps like WordPress, Nextcloud, GitLab on your server. Find out more or install now.


Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Bookmarks
  • Search
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo

Cloudron Forum

Apps | Demo | Docs | Install
  1. Cloudron Forum
  2. N8N
  3. Converting JSON

Converting JSON

Scheduled Pinned Locked Moved Solved N8N
5 Posts 3 Posters 703 Views 3 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • J Offline
      J Offline
      JLX89
      wrote on last edited by
      #1

      Has anyone had any luck converting JSON names using the SetKey or Function (Code) options in n8n? I've been trying to convert the following, but it seems to be failing.

      Configuration: Cron > Import RSS Feed > SetKey > Output to Directus

      {
      "postName": "Article Title",
      "link": "https://blog.com/post-name",
      "pubDate": "Sun, 19 Jan 2020 01:00:00 -0800",
      },
      

      "postName" > "title"
      "link" > "url"

      Any help with this would be greatly appreciated!

      benborgesB 1 Reply Last reply
      0
      • J JLX89

        Has anyone had any luck converting JSON names using the SetKey or Function (Code) options in n8n? I've been trying to convert the following, but it seems to be failing.

        Configuration: Cron > Import RSS Feed > SetKey > Output to Directus

        {
        "postName": "Article Title",
        "link": "https://blog.com/post-name",
        "pubDate": "Sun, 19 Jan 2020 01:00:00 -0800",
        },
        

        "postName" > "title"
        "link" > "url"

        Any help with this would be greatly appreciated!

        benborgesB Offline
        benborgesB Offline
        benborges
        wrote on last edited by
        #2

        @JLX89 I suspect the name of the fields on each side must be the same for the mapping to work ?

        BenB

        J 1 Reply Last reply
        0
        • benborgesB benborges

          @JLX89 I suspect the name of the fields on each side must be the same for the mapping to work ?

          J Offline
          J Offline
          JLX89
          wrote on last edited by
          #3

          @benborges I'm not sure, kind of at a loss. So I basically have it setup like this currently and I've tried both SetKey and RenameKeys:

          1. Schedule (1 hour)
          2. Scan RSS Feed
          3. Attempt Rename
            -- SetKey
            -- RenameKeys

          FROM

          {
          "postName": "Article Title",
          "link": "https://blog.com/post-name",
          "pubDate": "Sun, 19 Jan 2020 01:00:00 -0800",
          },
          

          TO

          {
          "title": "Article Title",
          "url": "https://blog.com/post-name",
          "pubDate": "Sun, 19 Jan 2020 01:00:00 -0800",
          },
          

          Thank you!

          martinkbsM 1 Reply Last reply
          1
          • J JLX89

            @benborges I'm not sure, kind of at a loss. So I basically have it setup like this currently and I've tried both SetKey and RenameKeys:

            1. Schedule (1 hour)
            2. Scan RSS Feed
            3. Attempt Rename
              -- SetKey
              -- RenameKeys

            FROM

            {
            "postName": "Article Title",
            "link": "https://blog.com/post-name",
            "pubDate": "Sun, 19 Jan 2020 01:00:00 -0800",
            },
            

            TO

            {
            "title": "Article Title",
            "url": "https://blog.com/post-name",
            "pubDate": "Sun, 19 Jan 2020 01:00:00 -0800",
            },
            

            Thank you!

            martinkbsM Offline
            martinkbsM Offline
            martinkbs
            wrote on last edited by
            #4

            @JLX89 Simple!

            5295ea29-7ee0-4537-b123-f59622ca97ce-image.png

            1884c7ee-8ccb-40a8-9300-84caa2cb92af-image.png

            😉

            J 1 Reply Last reply
            4
            • martinkbsM martinkbs

              @JLX89 Simple!

              5295ea29-7ee0-4537-b123-f59622ca97ce-image.png

              1884c7ee-8ccb-40a8-9300-84caa2cb92af-image.png

              😉

              J Offline
              J Offline
              JLX89
              wrote on last edited by
              #5

              @martinkbs Perfect, thank you so much!

              1 Reply Last reply
              1
              • nebulonN nebulon marked this topic as a question on
              • nebulonN nebulon has marked this topic as solved on
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


                • Login

                • Don't have an account? Register

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • Bookmarks
                • Search