PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

Change format of displayed data in admin

  1. I have been asked if it is possible to change the format for certain data to make it easier to transfer to another application from the entry admin display, such as birth date formatted MMDDYYYY without dashes or slashes. Which is the preferred method to do this?

    - Change the form field type from Date to just a single line text with a custom mask?
    - Change the template that displays the data in an Entry

    thx - Steve

    Posted 11 years ago on Monday January 14, 2013 | Permalink
  2. There are a couple ways of doing it. You could create a function and use the gform_pre_submission_filter to convert your date field to a format more compatible with your other application, then store that date in the entry and transfer that to your other application.

    http://www.gravityhelp.com/documentation/page/Gform_pre_submission_filter

    You could do it with the mask, although you could end up with invalid birth dates like 99242019 - I don't like that idea too much.

    There is also a way to store the data as you are now, in the entry, but modify it before it is displayed in the admin.

    http://www.gravityhelp.com/documentation/page/Gform_get_input_value
    http://www.gravityhelp.com/documentation/page/Gform_save_field_value

    Depending on when you are sending the data to the other application, this may or may not work for you.

    I think I would use gform_pre_submission_filter and just convert the data and store it in a hidden field, then send that to your other application.

    Posted 11 years ago on Tuesday January 15, 2013 | Permalink