"For Each" loop on for MAP variables

Found this open needed feature today. Still now way to iterate through the map for checking keys?
I need a solution for something like “give me all keys/values with key greater 5”. Without iterating it’s a lot of nodes/calls.
Without that feature, I have to make map to array of keys, then look for keys, then take the keys and look for values in the map again :frowning:

Get the Keys, then loop through them and find by key from the Map variable. Kinda rough on performance to do it this way, but that’s the only way I can find using just BPs. Id suggest to go to C++ though.

Thank you. I hope loop maps will be exposed to BPs soon.

Just you will need extra step.
Iterate through keys and do for each and find keys and use them both.


You can thank me later :smiley:

2 Likes


Hope this work…

1 Like

I tried creating my own macro library with input map of wildcards to wildcards and implementing iterating map keys and finding value by key, but with:

  1. Iterating keys with foreach - The type of Target Array is undetermined error on Length in foreach loop macro
  2. Iterating range of indices of keys / finding value by key and iterating values and keys:
    my resulting macro gives key type on both key and value…

So better just iterate keys in your blueprints. 5.0.3


3 Likes

Not related to the original question, but I like your blueprinting style dude. Might start emulating it myself. Looks like a subway map! How did you get it to look like that? I don’t see any reroute pins…

Its an addon.

There you go.

1 Like

You ever figure out the fix for the 2nd wildcard (for value element) to be the proper type?

Nah