Map of type String to Widget UI

I have a map of strings and want to render it in a UI widget. Closest to solution was found here but I cant figure this out due to that this map is of type string.
The result of my anguished attempts is that the widget only renders the first key/value pair even though its just a string. This is an attempt to render it in a text widget:

I get the map from an external function, that I dont want to change, (Get Metadata Values as String For Face)

…and then bind the result to Textblock

The Print String prints the Map as I want it to. So, how do I get around this and preferably as Text for styling purposes?

In your for loop, you have to append Metadata Text as well. As of now, you’re just replacing it with the latest element.

1 Like

Ok, thank you, I tried several attempts but I need some more guidance please. How do I append the loop to the Metadata Text setter before the key/value String has been appended to a String?

Sure- this is what I meant

This will display as:

Key: Value
Key: Value
Key: Value

etc

Though there will be an extra empty line at the end that may mess with your formatting.

A is the current value
B is the key
C is a colon with a space following it
D is the value
E is a new line, you have to press shift+enter to get it since enter just exits the textbox

Also, it seems that Metadata text is a not-local variable, so make sure to clear that before going into the loop

2 Likes

This topic has been moved from International to Programming & Scripting: Blueprint.

When posting, please review the categories to ensure your topic is posted in the most relevant space. This thread has been moved to help other devs with a similar question.

Good luck and happy developing! :slight_smile:

1 Like