How to randomly label and color blocks from puzzle game tutorial

Hey guys,

Very new to UE4. I am essentially trying to recreate a game I made in gamesalad for a class project.

What I’m needing to do is randomly label the blocks from the puzzle game tutorial 1-9, and color them accordingly

I had some success randomly assigning colors from this video: Intro to Materials: Dynamic Material Instances cont. | 10 | v4.0 Tutorial Series | Unreal Engine - YouTube

But was unable to limit the number of appearances.

Any help would be greatly appreciated on either topic.
Thanks!