touniformstring not working as i expect

i have an interface that displays a grid of data returned from a DB. One of the columns has a numerical ID column. 
Rather than show the id, i would like to show it's associated value which is in a different lookup table.

The interface has two main rules
local!xxx: gets the table data
local!yyy: gets the lookup data.

The lookup data is returned as :

[lookupId:123,value:Toys]; [lookupId:456,value:Games]

In my grid field, i set the column as a text field with the following as value:

index(local!xxx,wherecontains(fv!item.id,local!yyy),{})

However im' getting the message can only act on data of the same type (Text, Any Type)

I've tried to enclose in touniformstring, but it has no effect. 

ps. whats with the tags ? i had to write this out 3 times before i reliased not to click on the tags function)

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Lead Developer

    I'm not sure what your table data looks like or what the forEach items are, but I'm guessing you'd need something like:

    index(local!xxx,wherecontains(fv!item.id,touniformstring(local!yyy.lookupId)),{})

    1) index into local!yyy so the wherecontains is looking at the right fields

    2) touniformstring (maybe) on the local!yyy[field] to ensure the Text->Text comparison

Reply
  • 0
    Certified Lead Developer

    I'm not sure what your table data looks like or what the forEach items are, but I'm guessing you'd need something like:

    index(local!xxx,wherecontains(fv!item.id,touniformstring(local!yyy.lookupId)),{})

    1) index into local!yyy so the wherecontains is looking at the right fields

    2) touniformstring (maybe) on the local!yyy[field] to ensure the Text->Text comparison

Children
No Data