Here's an example I already had built from years ago comparing a text object to a value. That text object could be tied to your datalinq or you can use a datalinq block.

Alternatively you can script something like;
dim Slab as xpSlabObject
dim Blu, Red, Grn as xpMaterial
dim Value as xpTextObject
self.GetObjectByName("Slab1",Slab)
self.Project.GetMaterialByName("Blue",Blu)
self.Project.GetMaterialByName("Red",Red)
self.Project.GetMaterialByName("Green",Grn)
self.GetObjectByName("Text1", Value)
if Value.Text = "Blue"
Slab.SetMaterial(1,Blu)
else if Value.Text = "Red"
Slab.SetMaterial(1,Red)
else
Slab.SetMaterial(1,Grn)
end if
------------------------------
Simon Redmile
Senior Graphic Programmer & Designer
Ross Video
Bristol United Kingdom
------------------------------
Original Message:
Sent: 09-27-2022 10:01
From: Svetlin Aleksandrov
Subject: Visual Logic Color Change based on DataLinq Strings?
Hello,
I have a .xlsx sheet with some names on it. In the project I have a quad and a text object over it, so I need to change the color of the quad based on string/name from the DataLinq object. I have lets say 11 possible names, so we have same amount of colors (11) to chose from.
I need something like:
if(name1)
quad color = color1
if(name2)
quad color = color2
etc..
or something like switch
switch(names):
case name1: quad color = color1
break
case name2: quad color = color2
break
is it possible to do it with VisualLogic?
------------------------------
Svetlin Aleksandrov
Motion Graphic Designer
Euronews Bulgaria
------------------------------