You should follow some tutorial/documentation about blueprint communication.
Getting infromation out or in to umg blueprints is not easy.
Easiest way for your case would be:
create event in game mode (or other easily accessible blueprint) lets name it “Event_Change_Material”
create event dispatcher in same blueprint “Dispatcher_Change_material”
from umg blueprint call that event in game mode “Event_Change_Material” when umg is updating slider
now you need actor with that dynamic material (and mesh), because to change dynamic material during runtime you need to create dynamic material instance, else it will not change in runtime. So easiest is to have actor and in its construction script create instance, then apply to mesh.
in that actor assign to dispatcher “Dispatcher_Change_material” then change material when it is called.
Problem has 2 separate tasks:
signaling actor with material that it needs to change
changing material
So split it in two, first work on communication (ie. print some output when actor gets signal to change material). Then work on changing material. So many problems with blueprints arise when you have multiple errors (bugs) and nothing seems to work, so fix that stuff step by step.