Pricing Blog

Issue with from entries

  • knechtus-1377675811888562366

    knechtus paulus

    6 months ago

    Hello everyone,
    I'm currently working on a university project and I'm a bit stuck because I'm having an issue with the "from entries" node. I'm trying to create a JSON object with the structure {[id]: isFilled} to save it in local storage. For this, I'm using two Array nodes that lead into the "from entries" node. My problem is that I don't understand why I'm only getting undefined null in the output.
    Have a look at the attached image

    I've already tried several debugging steps to find the cause:
    1. I checked if getid and isFilled provide the correct values. Neither of the values were initially undefined or null.
    2. I set the value of the isFilled variable to a number instead to see if the issue was related to the interpretation of false.
    3. I set defaults using the Default to node, but this also didn't change the undefined null output.

    Maybe I'm just doing it completely wrong or I have a fundamental misunderstanding, so I'd be very grateful for your help.
    1377675812119253102-from_entries.png
    1
  • whitep4nth3r-1377676735541411850

    salma

    6 months ago

    try removing this node, as this is creating an array within an array
    1377676735293685771-image0.jpg
  • The double brackets here show an array within an array
    1377676886083240069-image0.jpg
  • knechtus-1377678186766274612

    knechtus paulus

    6 months ago

    already tried that, but it didn't change anything in the output
    1377678186636116008-image.png
  • whitep4nth3r-1377680898106851510

    salma

    6 months ago

    Can you share a link to your project?
  • knechtus-1377681926093148241

    knechtus paulus

    6 months ago

  • knechtus-1377682425131307019

    knechtus paulus

    6 months ago

    oh wait, that's not the link to the current branch... you won't be able to see it here
  • whitep4nth3r-1377682915462221908

    salma

    6 months ago

    If your project is public you can just send over the editor URL
  • Tod-1377683444393443428

    Tod

    6 months ago

    Great job @knechtus paulus! Your contribution to the Nordcraft Community just made you advance to Community Level 1! 🌲
  • whitep4nth3r-1377684640441172100

    salma

    6 months ago

    Is there a reason why this data structure isn’t suitable?
    1377684640260952155-IMG_2828.jpg
  • I’m still playing around with it
  • whitep4nth3r-1377685190196985978

    salma

    6 months ago

    Honestly from entries should be working so I’m not sure
  • whitep4nth3r-1377686416397434974

    salma

    6 months ago

    I can see why you probably want an array of arrays given this

    https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/fromEntries

    @Andreas Møller any advice here?

    I am getting the same result as @knechtus paulus with a single array and an array of arrays
  • andreasmoller-1377686816320127007

    Andreas Møller

    6 months ago

    Yeah fromEntries works differently in Nordcraft

    It takes an array of objects with {key, value}
  • knechtus-1377687909573853297

    knechtus paulus

    6 months ago

    Yes, there is a reason: getId should become my key and isFilled the value, so that I can theoretically get a structure like this: { test: false, test2: true, test3: true }
  • whitep4nth3r-1377688075123163188

    salma

    6 months ago

    1377688074955526234-IMG_2829.jpg
  • I’m still ending up with this so I’m stumped 😅
  • andreasmoller-1377688498844340224

    Andreas Møller

    6 months ago

    No literally “key” and “value
  • whitep4nth3r-1377688541529768167

    salma

    6 months ago

    OH
  • I shall document this 😅
  • 1377688850834657330-IMG_2831.jpg
  • There you go!
  • knechtus-1377688925463642182

    knechtus paulus

    6 months ago

    thanks
  • whitep4nth3r-1377688954505134180

    salma

    6 months ago

    You’re welcome!