How to use a string from a data table to update image in UMG

Ok this is an interesting one because I found a lot of varied ways to do this in a round about way but a lot of them required C++ and I just don’t feel competent with coding and I feel like there must be a blueprint way to do this.

I have a data table for my AI guys. Among the things it tracks by levels, is a class icon. In my AI UMG file, I have The AI level, name, health bar and class icon. I have a default icon set but I want to know how to use the file location set in the data table to show the appropriate icon.

139538-screen+shot+2017-05-28+at+2.17.08+pm.png

139540-screen+shot+2017-05-28+at+2.20.47+pm.png

Well I added a trace. The data is getting pulled but I am unable to figure out the part where the image component in UMG gets the string location and places the correct image. I also noticed one of my above screenshots was useless…

139568-screen+shot+2017-05-28+at+5.21.21+pm.png

139569-screen+shot+2017-05-28+at+5.22.17+pm.png

I think this should work. First by setting the table asset, you’ll get the rows. Then by determining the row index, it will return the corresponding row. Then by breaking it, you will be able to get the specific row element. From there you can get all data you want.

Regards.

I think that shouldn’t be a string type in the datatable, rather a TAssetPtr type (if I remember well). That way you should be able to just set it.