Applying multi material to several objects.

Hi everyone!
I need to apply multy material to several objects and I got this BP.It apply material just to one material ID which I will write in the node Set material.
I think I need to create a loop with Get material index node, but I don’t understand how to make it.So explain me, please.
Thanks in advance for your replies!