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
  • vimalkumars suggested you use the displayvalue() function which in effect is conducting a local lookup of the lookupId value and returns the correlating value (e.g. to substitute 123 for 'Toys'). This should work, but does result in your interface performing TWO round-trips to the database (one to get the data, a second to get the lookup data). 

    An alternate option would be to 'join' this data into a VIEW in the database so that when you retrieve the data the lookup has in effect already been performed. You'd then only be performing ONE round-trip to the database.

    (it may be that you only gain a marginal performance benefit but you should be aware of this as an option)

Reply
  • vimalkumars suggested you use the displayvalue() function which in effect is conducting a local lookup of the lookupId value and returns the correlating value (e.g. to substitute 123 for 'Toys'). This should work, but does result in your interface performing TWO round-trips to the database (one to get the data, a second to get the lookup data). 

    An alternate option would be to 'join' this data into a VIEW in the database so that when you retrieve the data the lookup has in effect already been performed. You'd then only be performing ONE round-trip to the database.

    (it may be that you only gain a marginal performance benefit but you should be aware of this as an option)

Children
No Data