- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Question on Node Red
I am admittedly new to node red... just as a warning. 🙂
We manage multiple organizations. I have the output of GetOrganizations, and am splitting that and running getNetworks.
I need to collect all the JSON outputs of each getNetworks call and join them and send it over to a different function that harvests analytics data.
right now, each network goes to the Analytics function individually. I need it to wait, and then go at the same time...
does that make sense? Thanks for any advice!!
Solved! Go to solution.
- Labels:
-
Code Sample
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Ipopejoy,
I tried to use the function called "Join" to join the outputs of "getnetworks" and get a complete output of single object. I am not sure if this is what you are looking for or if it is different with JSON. FWIW, please find the output of getnetworks, parsed through join below.
Worked well with JSON as well.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Ipopejoy,
how did you manage to retrieve the output of getOrganization and feed it as input to getNetworks?
The getOrganizationetworks has a field msg.organizationId and I am unable to to feed this dynamically. Can you please share how you did this?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@Sriram Sure:
The real key is to take output of getOrg and split it (this is only needed if you have multiple organizations), run it into a limiter to not hit API limits, and then run from that into a function. The function right before "getNetwork" is this:
msg.organizationId=msg.payload.id
return msg;
This sets the msg.organizationID that getnetworks is looking for from the value that was obtained in the getOrganizations query.
Hope that helps!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks a lot Ipopejoy. This was useful and now I was successfully able to retrieve my networks dynamically!. Thanks for your help again.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Ipopejoy,
I tried to use the function called "Join" to join the outputs of "getnetworks" and get a complete output of single object. I am not sure if this is what you are looking for or if it is different with JSON. FWIW, please find the output of getnetworks, parsed through join below.
Worked well with JSON as well.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
GetOrganizationNetworks returns multiple values for you, right?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
That is right. It returns 5 networks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Nice, you inspired me to revisit that option, and I found the issue! 🙂
In my case, I had an org that was disabled because they had closed the business, and that was causing an error and causing the JOIN node to not work correctly!
