GRAVITY PERKS UNIQUE ID 1.3.19

0
95

What does it do?

The Unique ID perk provides a new “Unique ID” field type which generates a unique ID for the entry when submitted. It supports several types of unique IDs including alphanumericnumeric, and sequential.

Common Uses

  • Provide a set-length confirmation or reference number for each entry; could be displayed on the confirmation page and in notifications (i.e. “Your confirmation number is ABC142Z3”).
  • Maintain a sequential invoice number (a legal requirement for some countries)
  • Generate a unique coupon code that can be used on subsequent form submissions (tutorial coming soon!)
  • Generate a unique number for use in raffles

There are probably a hundred other ways this could be used. We would really love to hear how you’re using it!

How does it work?

This plugin provides a new “Unique ID” field type (available in the “Advanced Fields” group). When a form containing a “Unique ID” field is submitted, a unique ID is generated and populated for this field. The ID is unique to the form and field.It’s important to note that in order to guarantee that the ID is truly unique, the field is populated only after the form has been successfully submitted. Since the field has no value prior to submission, this field is not visible on the frontend.

How do I enable this functionality?

  1. Open the form on which you would like to include this functionality.
  2. Open the “Advanced Fields” group on the right side of the form editor.
  3. Find and click on the “Unique ID” field button.

    GP Unique ID Field Button
  4. Modify the field settings as needed. See below for full details on the available field settings.
  5. Save your changes by clicking the “Update Form” button.

Field Settings

Standard Settings

gp-unique-id-field-settings

GP Unique ID Standard Field Settings

  • Field Label
    The label of the field. Visible in the {all_fields} merge tag and on the entry detail and entry list views.
  • Type
    The type of unique ID that will be generated for this field.
    • Alphanumeric
      Contains letters and numbers (i.e. a12z9).
    • Numeric
      Contains only numbers (i.e. 152315902).
    • Sequential
      Contains only numbers and is sequential with previously generated IDs per field (i.e. 123).

Advanced Settings

gp-unique-id-field-settings-advanced

GP Unique ID Advanced Field Settings

  • Starting Number
    Set the starting number for sequential IDs; only available when “Sequential” type is selected.
  • Length
    Set a specific length for the generated ID (excluding the prefix and suffix) or leave empty to use default length. There are some differences in length requirements for each ID type.
    • Alphanumeric
      Requires a minimum length of 4.
    • Numeric
      Requires a minimum length of 9 and a maximum length of 19.
    • Sequential
      Length is used to pad the number with zeros (i.e. an ID of 1 with a length of 5 would be 00001). There is no minimum length.
  • Prefix
    Prepend a short string to the beginning of the generated ID (i.e. abc123890678). You can use merge tags; the list is available via the “Merge Tags” icon located on the right of the field.
  • Suffix
    Append a short string to the beginning of the generated ID (i.e. 123890678xyz). You can use merge tags; the list is available via the “Merge Tags” icon located on the right of the field.

Display the Generated Unique ID

You can display the unique ID generated for any unique ID field using the merge tag for that field. This will be available in the Gravity Forms’ default merge tag lists.

Unique ID fields are automatically included in Gravity Forms {all_fields} merge tag.

Use with PayPal

The unique ID can be generated once PayPal Standard has captured the payment. This delay is enabled via the gpui_wait_for_payment filter.


Hooks


Related Articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here