This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal



May 25, 2011, 9:21 AM
51 Posts

Re: lookup only first value from multiple value field

  • Category: Other
  • Platform: Windows
  • Release: 8.5.2
  • Role:
  • Tags:
  • Replies: 6
 I tried :
 var first = @Subset(key,1);
key contains "V100,V300" 
in this example the var  first still is  : "V100,V300" 
the value of first should be V100 only. 
Isn't their a possibility to look for the ","  in the string and just cut off the rest ?  
May 25, 2011, 2:28 PM
298 Posts
*Look up the String object on the web, indexOf and subString...
May 25, 2011, 4:36 PM
47 Posts
Re: lookup only first value from multiple value field
 You could of course use key.split(",") , but you might want to find out why your multi-value key is being returned as a single string. Are you "@implode"ing the value in your view? Is the original field really multi-value or is it just a comma delimited string?
 
I tend to use the non-"@" formula methods (such as database.getView("viewName").getEntryByKey(keyValue)) as they are a bit more transparent and easier to debug.  Under the hood, @DbLookup is doing the same thing, but the direct methods give you access to intermediate components to check if everything is as you expect.
 
Rich 

This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal