Hi,
I try to create function which filters data out based on values.
I only need values where visible is true. I've been banging my head against wall now 2 days for this.
Thank you very much, for help.
Br,
Ville
             
            
              
            
           
          
            
            
              Assuming that this array of objects is in msg.payload then a simple Javascript function would work:
msg.payload = msg.payload.filter(o => o.visible);
return msg;
Since you said you don't want to use the function node, I would tend to use a change node with this JSONata expression:
payload[visible=true]
Actually, I was surprised to see that there is no built-in core node called filter or some such thing... I thought there was one. Did I just miss it?
             
            
              
            
           
          
            
              
                E1cid  
              
                  
                    16 February 2021 15:43
                   
                  3 
               
             
            
              Try using change node and JSONata
payload[visible=true]
[edit] i see @shrickus  already suggested it.
             
            
              
            
           
          
            
            
              Thank you, now I got it working.
Br,
Ville
             
            
              
            
           
          
            
              
                system  
              
                  
                    3 March 2021 04:56
                   
                  5 
               
             
            
              This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.