Skip to main content
Grain: TYPE_REFERENCES — one row per valid code value, keyed on ENTITY + PROPERTY + VALUE.
Many columns in the data model store numeric codes rather than text labels. TYPE_REFERENCES is the decode key — it maps each code to its display label.

Decode pattern

SELECT
    g.GIFT_KEY,
    g.AMOUNT,
    ref.DESCRIPTION AS GIFT_TYPE_LABEL
FROM [database].[schema].GIFTS g
LEFT JOIN [database].[schema].TYPE_REFERENCES ref
    ON ref.ENTITY    = 'Gift'
    AND ref.PROPERTY = 'GiftType'
    AND ref.VALUE    = g.GIFT_TYPE::VARCHAR
WHERE g.GIFT_IS_DELETED = FALSE
Join on all three columns — ENTITY, PROPERTY, and VALUE (cast to VARCHAR) — to decode any numeric code field. Always use a LEFT JOIN to retain rows where the code is null or not yet in the reference table. See Query overview for more examples.

Most commonly needed lookups

Gift — GiftType

The payment method recorded on the gift transaction.
CodeLabel
0Cash
1Check
2Credit
3Electronic Funds Transfer
4Non-cash
5Stock
6Other
7Reversing Transaction
8Cryptocoin
9Qualified Charitable Distribution
10Pledge
11PayPal

Gift — TributeType

CodeLabel
1In Honor Of
2In Memory Of

RecurringGift — Status

CodeLabel
0Past Due
1Up-to-date
2Cancelled
3Fulfilled

RecurringGift — Frequency

CodeLabel
0Once
1Weekly
2Bimonthly
3Monthly
4Quarterly
5Semiannually
6Annually
7Biennially
8Daily
10Custom

Pledge — Status

CodeLabel
0Past Due
1Up-to-date
2Cancelled
3Fulfilled
4Write-off

Pledge — Frequency

CodeLabel
0Once
1Weekly
2Bimonthly
3Monthly
4Quarterly
5Semiannually
6Annually
7Biennially
8Daily
10Custom

Task — TaskStatus

CodeLabel
0Not Started
1In Progress
2Blocked
3Completed
4Dismissed
5Voided

GiftAskStatus — GiftAskStatusType

CodeLabel
0Active
1Declined
2Closed

Contact — BaseContactType

CodeLabel
0Household
1Foundation
2Organization

All entities in TYPE_REFERENCES

Run this query to pull all current lookup values from your environment:
SELECT ENTITY, PROPERTY, VALUE::NUMBER AS CODE, DESCRIPTION AS DISPLAY_NAME
FROM [database].[schema].TYPE_REFERENCES
ORDER BY ENTITY, PROPERTY, CODE;
Entities present in this table: Contact, ContactActivity, ContactAddress, ContactMethod, ContactWealth, CustomField, CustomFieldGroup, Email, Gift, GiftAskStatus, Membership, Pledge, PlannedGift, RecurringGift, Segment, SentEmail, SentEmailEvent, Task, Tribute.
Data freshness: These tables sync continuously from Virtuous CRM. Typical lag is under 4 hours. To check when a record was last updated, inspect the SF__ROW_SYNCED_DATE_TIME_UTC column on any table.
Last modified on May 22, 2026