Get Lookup Text from Lookup Field

My InterestGroup form has a concept of “Portfolio”. Every group has a portfolio, either A, B, C or D. These are the friendly names. in the Portfolios table, each one has a PortfoliosKey which is a GUID, and the Portfolio field contains the letter.

The Portfolio field on the form is defined as a lookup, and of course uses the GUID stored in the InterestGroups table for Portfolio to do the lookup. but the field just displays A, B, etc.

Is there any way, without doing a seperate lookup in code, to identify real-time the letter being displayed in that lookup field?

I need that because I have five variable keyed by the letter: {A:{xxxx,xxxx,}, B:{xxx,xxx}}
This variable is stored in my settings table, and it doesn’t make sense for the user to know the GUIDs.

Thanks…

Hi Ron,

Thanks for submitting this question.

In case you intend to use the Portfolio code to feed a five.variable, you can use the property metadata, which gives you access to the lookupkey (GUID) and the lookupvalue (the information displayed)

There are the property definitions:
five.metadata.formID.fieldID.lookupkey

five.metadata.formID.fieldID.lookupvalue

The image below shows one example, in which I am using a form called ‘Stocks’ and lookup fields: ‘SectorKey’ and ‘StockExchangeKey’.

Regards,

Elton S