I’m a WeWeb noob, so this is probably a very basic question but I can’t seem to figure it out.
I have created a list of variables that contains credential types, along with an associated colour for each type of credential. How can I return the colour value when a certain type is active.
The first screenshot shows that I have bound the elements background colour to the collection “Cred Types”
I’ve then added a filter to return the type of cred the current item is.
This is working but I now need to return the variables key “Colour” #FFBC9B but don’t know how to retrieve it from here.
I’ve applied the filter and used getKeyValue but it’s giving me the error that the First parameter should be an object. I’m clearly not using it correctly.
Based on the image you first attached, you can try to switch to Javascript (on the Formula dropdown) and do [Cred Types][0].colour ([Cred Types] should be the green variable. The braces are just for illustration purposes.)
This should return #FFBC9B
I’m not really sure whether this is an array, looks like it might be. If it is an object structured like that, then you might try [Cred Types]['0'].colour
I’m basically populating the table with credentials.
Each credential has a cred_type.
I need to cross reference that cred_type with the variable collection and return the variable’s key “colour”