web stats
Java script Question: How to retrieve filter value from batKicks variable - Mirth Community

Go Back   Mirth Community > Mirth Connect > Support

Reply
 
Thread Tools Display Modes
  #1  
Old 06-16-2019, 01:37 AM
shuhaibk54 shuhaibk54 is offline
OBX.1 Kenobi
 
Join Date: Jan 2018
Location: Abudhabi
Posts: 26
shuhaibk54 is on a distinguished road
Send a message via AIM to shuhaibk54 Send a message via Skype™ to shuhaibk54
Default Java script Question: How to retrieve filter value from batKicks variable

var sidekicks = [
{ name: "Robin", hero: "Batman" },
{ name: "Supergirl", hero: "Superman" },
{ name: "Oracle", hero: "Batman" },
{ name: "Krypto", hero: "Superman" }
];
var batKicks = sidekicks.filter(function (el) {
return (el.hero === "Batman");
});

logger.debug("batKicks"); // It doesn't work .
Reply With Quote
  #2  
Old 06-17-2019, 11:42 AM
agermano agermano is offline
Mirth Guru
 
Join Date: Apr 2017
Location: Indiana, USA
Posts: 965
agermano is on a distinguished road
Default

You're sending it as a string, so it should be logging "batKicks."

Take off the quotes to reference the variable. Since it's an array of objects, you'll probably want to convert to JSON first to log it.

Code:
logger.debug(JSON.stringify(batKicks));
Reply With Quote
Reply

Tags
array, java javascript

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -8. The time now is 04:40 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2019, vBulletin Solutions, Inc.
Mirth Corporation