Support » Plugin: Gravity Forms Directory » gf_entry_meta table labels for meta_key values

  • Greetings,

    I’m writing an add on that will read an entry view for a completed registration form (which I made, and obviously has variable fields). I can get the field values from the meta_values field of the gf_entry_meta table. But the corresponding values in the meta_key field aren’t straightforward values like “first_name” or “last_name”, etc., but are number values like “7” or “9”. Where in the gravity forms tables can I find the label values that correspond to the gf_entry_meta.meta_key field values, so that I can find something like “last_name” = “7”?

    SELECT gf_entry_meta.meta_key WHERE some_table.some_field = “first_name” (or something like that)

    Here’s a sample of three records or rows from the gf_entry_meta table to illustrate my problem:

    id = 161
    form_id = 1
    entry_id = 14
    meta_key = 7
    meta_value = Gregory

    *****

    id = 162
    form_id = 1
    entry_id = 14
    meta_key = 8
    meta_value = G

    *****

    id = 163
    form_id = 1
    entry_id = 14
    meta_key = 9
    meta_value = Lewis

    *****

    You can see that the first record is a first name, the second record is a middle initial, and the third record is a last name, and so on and so forth. Nothing in the record says the meta_value is a first name, I have to know it intuitively because I made the form and filled it out. There has to be something in some table that says something like, “Oh, and by the way, the meta_key value “7” in the gf_entry_meta table is an alias for “first_name”.

    I could hard code something like “first_name = meta_value where meta_key = 7”, but that meta_key value could change as soon as I edit the form, or even create a new form.

    • This topic was modified 1 month, 1 week ago by  coconutcoder.
    • This topic was modified 1 month, 1 week ago by  coconutcoder.
  • You must be logged in to reply to this topic.