Pricing Blog

Find a specific object of my array store in local storage

  • jehex-1403307728142733423

    Jehex

    4 months ago

    Hi there, sorry it's obvious but the ai assistant not working for me and as I working with data from local storage I cannot really see what Im getting into the formula tab.

    Im just wondering how get a specific object from my array of object by looking for one of his key/value ( let's said I want to get the object who contain the key value name = nicolas ) Thanks you 🙂
  • whitep4nth3r-1403308621609173043

    salma

    4 months ago

    1403308621386748054-image.png
  • My people array is this, which is hopefully something similar that you have

    [
    {
    "name": "nicolas"
    },
    {
    "name": "bob"
    }
    ]
  • whitep4nth3r-1403309429696364566

    salma

    4 months ago

    you could also add an input to the formula, which you could use in the second value of "equals" to make the formula dynamic
  • jehex-1403312314362495098

    Jehex

    4 months ago

    Thanks Salma, was connecting the node get from Local storage directly to Filter node, I create a variable initialized by the local storage value and now Im able to see the data and its working. Thanks you
  • whitep4nth3r-1403323617286033471

    salma

    4 months ago

    you're welcome!
  • you can also get from local storage by key though
  • jehex-1403345503537729618

    Jehex

    4 months ago

    Thanks ! 😄
  • jehex-1403380689163911230

    Jehex

    4 months ago

    Ah Salma Im sorry one more question, Im trying to get the prompt system of one of my influencer ( from a object array ) . When I set the name manually ( here aria-kelly ) Everything work fine, I get the prompt, but when Im setting a variable ( who contain also the name " aria-kelly " , I debugged it ) Im getting undefined 🙁
    1403380688719183912-c.png
    1403380688962588702-Untitled.png
  • jehex-1403383212411191401

    Jehex

    4 months ago

    seems the data I take from my local storage are visible on my editor but not on the preview of my app
  • whitep4nth3r-1403383374483034224

    salma

    4 months ago

    do you need to perform any actions on the preview of the app in order for local storage to populate, or should it populate on load?
  • jehex-1403383600396632165

    Jehex

    4 months ago

    I init the variable Influencerlist with the data get from the key ( local storage ) on load
  • jehex-1403383912532541491

    Jehex

    4 months ago

    1403383912205652160-cc.png
  • whitep4nth3r-1403385023326982336

    salma

    4 months ago

    how do you put the data into local storage?
  • jehex-1403385473421934672

    Jehex

    4 months ago

    In my app, as soon as the user open my " influencer " browser it's load the api who get all influencers from the database and set the list into the local storage
  • whitep4nth3r-1403386805461454972

    salma

    4 months ago

    and that's running on success of the API call?
  • jehex-1403386999468982302

    Jehex

    4 months ago

    Yep, just did a test with Size node and it's working, Im getting the correct number of elements in preview mode
    1403386999196614737-Untitled.png
  • whitep4nth3r-1403387262275944498

    salma

    4 months ago

    I'm gonna need a link to your project to further debug why you don't see local storage on your preview
  • whitep4nth3r-1403387604082360332

    salma

    4 months ago

    please 🙂
  • jehex-1403388736850362441

    Jehex

    4 months ago

    I think I almost fix the issue, Im getting a number of objects so its mean the preview mode get the data but Im not getting the full data , it's a issue of cache, I modify something with Xano for return all the data of my records but its has been not updated on nordcraft, I will delete the cache
    1403388737014071366-Untitled.png
  • jehex-1403389001611743403

    Jehex

    4 months ago

    when you work with data from local storage and you need to update theses data, the only way is to delete the cache or is theyre another way ?
  • whitep4nth3r-1403390307252441138

    salma

    4 months ago

    yeah delete the local storage items in your dev tools
  • you could also put a test button on your page for easier development which clears local storage
  • jehex-1403391337004400823

    Jehex

    4 months ago

    Alright I did it and now its work thanks a lot, I have a laaast question 😛 When I delete the local storage, it's only from my side but let's said the app is live and theyre is already X users connected, how update the local storage and reset it for everyone
  • lucasg-1403391521834926230

    Lucas G

    4 months ago

    Run a workflow on page load
  • You can do it all with the native actions 🙂
  • jehex-1403391640839782510

    Jehex

    4 months ago

    ok thanks you, will create a workflow for reset just in case 🙂
  • lucasg-1403391768418062396

    Lucas G

    4 months ago

    If the key already exists then you can set it to an empty string for example
  • Null is not a valid value (like cookies)
  • jehex-1403391977713827892

    Jehex

    4 months ago

    ok nice, will create some by default. Im working a lot on storage session for optimize the api calls / speed, it's very efficient