Topic
  • 8 replies
  • Latest Post - ‏2012-10-08T05:08:42Z by SystemAdmin
Rocky_01
Rocky_01
32 Posts

Pinned topic Getting a particular column value of a Lookup Table

‏2012-10-05T07:44:52Z |
Hi,

i am using "lookupValues(objLkp,strLkpkey)" for getting the values of a look up table. But it returns all the values, How can i restrict it to only a specified column value ?? e.g i am trying to populate the value for column having name as "URL".

Thanks in advance.

-Rocky
Updated on 2012-10-08T05:08:42Z at 2012-10-08T05:08:42Z by SystemAdmin
  • SystemAdmin
    SystemAdmin
    648 Posts

    Re: Getting a particular column value of a Lookup Table

    ‏2012-10-05T07:54:12Z  
    Hi Rocky,

    you can use getKeysFromValues()
    
    String[] LookupTable::getKeysFromValues(String[] values) Reverse lookup of keys using values fromthe lookup table. The values can either be Paths in the Spec or the columnnumber of the lookup table starting from 0 and not including the Key column.
    
  • Rocky_01
    Rocky_01
    32 Posts

    Re: Getting a particular column value of a Lookup Table

    ‏2012-10-05T09:02:22Z  
    Hi Rocky,

    you can use getKeysFromValues()
    <pre class="jive-pre"> String[] LookupTable::getKeysFromValues(String[] values) Reverse lookup of keys using values fromthe lookup table. The values can either be Paths in the Spec or the columnnumber of the lookup table starting from 0 and not including the Key column. </pre>
    Hi Alex,

    Thanks for the reply. But "getKeysFromValues" method returns keys for a particular value set. So i am not being able to use this method over here(as i need values for a particular column).Please correct me if i am wrong.

    Also if i can get some method which returns the display name for a particular look up then the above problem can be eradicated.
    Thanks again.

    Regards,
    Rocky
  • SystemAdmin
    SystemAdmin
    648 Posts

    Re: Getting a particular column value of a Lookup Table

    ‏2012-10-05T10:07:02Z  
    • Rocky_01
    • ‏2012-10-05T09:02:22Z
    Hi Alex,

    Thanks for the reply. But "getKeysFromValues" method returns keys for a particular value set. So i am not being able to use this method over here(as i need values for a particular column).Please correct me if i am wrong.

    Also if i can get some method which returns the display name for a particular look up then the above problem can be eradicated.
    Thanks again.

    Regards,
    Rocky
    Hi Rocky,

    Sorry, I thought you want to search by a value of a specific column. Well, what is a problem with lookupValues()? High memory or CPU consumption?

    And I didn't understand regarding the display name? What did you mean exactly?

    Regards,
    Alexander.
  • ArupKar
    ArupKar
    15 Posts

    Re: Getting a particular column value of a Lookup Table

    ‏2012-10-05T13:10:55Z  
    You can also use the lookup table as a catalog and get the attribute value. For example as below:

    var lkpCtg = getCtgByName("LkpTableName");
    var val = lkpCtg.getEntryAttrib("Lkp_Spec_Name/Attrib_Path);
  • ArupKar
    ArupKar
    15 Posts

    Re: Getting a particular column value of a Lookup Table

    ‏2012-10-05T13:14:02Z  
    • ArupKar
    • ‏2012-10-05T13:10:55Z
    You can also use the lookup table as a catalog and get the attribute value. For example as below:

    var lkpCtg = getCtgByName("LkpTableName");
    var val = lkpCtg.getEntryAttrib("Lkp_Spec_Name/Attrib_Path);
    Corrected the above code:

    var lkpCtg = getCtgByName("LkpTableName");
    var lkpItm = lkpCtg.getEntryByPrimaryKey("Pkey");
    var val = lkpItm.getEntryAttrib("Lkp_Spec_Name/Attrib_Path);
  • Rocky_01
    Rocky_01
    32 Posts

    Re: Getting a particular column value of a Lookup Table

    ‏2012-10-05T13:15:20Z  
    Hi Rocky,

    Sorry, I thought you want to search by a value of a specific column. Well, what is a problem with lookupValues()? High memory or CPU consumption?

    And I didn't understand regarding the display name? What did you mean exactly?

    Regards,
    Alexander.
    Hi Alex,

    Here i need to get the value of a particular column also i have selected that particular column as the display attribute. So if i can get any method for getting the display attribute of a specific Look up, then that could also help me. But i am unable to get any such method...... :(

    -Rocky
  • Rocky_01
    Rocky_01
    32 Posts

    Re: Getting a particular column value of a Lookup Table

    ‏2012-10-05T13:36:29Z  
    • Rocky_01
    • ‏2012-10-05T13:15:20Z
    Hi Alex,

    Here i need to get the value of a particular column also i have selected that particular column as the display attribute. So if i can get any method for getting the display attribute of a specific Look up, then that could also help me. But i am unable to get any such method...... :(

    -Rocky
    Hi Arup,

    Thanks for the valuable suggestion. I also have tried like that, but hte only problem is i am using 4-5 lookup tables at a time, so can't hard code/ pass the attribute value. Thats why now i am searching for a method which can return display name(as for all lookup Tables i am trying to get those attributes which are set as Display attribute.)

    -Regards,
    Rocky
  • SystemAdmin
    SystemAdmin
    648 Posts

    Re: Getting a particular column value of a Lookup Table

    ‏2012-10-08T05:08:42Z  
    • Rocky_01
    • ‏2012-10-05T13:15:20Z
    Hi Alex,

    Here i need to get the value of a particular column also i have selected that particular column as the display attribute. So if i can get any method for getting the display attribute of a specific Look up, then that could also help me. But i am unable to get any such method...... :(

    -Rocky
    Hi Rocky,

    Still not clear.
    There is no a display attribute in lookup tables. So what did you define as the display attribute? Can you show examples of your data with explanations?
    If you selected some column in your lookup table as the display attribute therefore your know its number, so you can get a value from an array returned by lookupValues()

    Regards,
    Alexander