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


    Cloudron Forum

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular

    Solved Converting JSON

    N8N
    3
    5
    59
    Loading More Posts
    • 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
      JLX89 last edited by

      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!

      benborges 1 Reply Last reply Reply Quote 0
      • benborges
        benborges @JLX89 last edited by

        @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 Reply Quote 0
        • J
          JLX89 @benborges last edited by

          @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!

          martinkbs 1 Reply Last reply Reply Quote 1
          • martinkbs
            martinkbs @JLX89 last edited by

            @JLX89 Simple!

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

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

            😉

            J 1 Reply Last reply Reply Quote 4
            • J
              JLX89 @martinkbs last edited by

              @martinkbs Perfect, thank you so much!

              1 Reply Last reply Reply Quote 1
              • Topic has been marked as a question  nebulon nebulon 
              • Topic has been marked as solved  nebulon nebulon 
              • First post
                Last post
              Powered by NodeBB