• Resolved donkiely

    (@donkiely)


    I have a data app project that has a main table and four child tables. One of the children, Admissions, has three date fields, and many of those fields have NULL values. The fields with dates appear correctly on the front end.

    But the NULL values are displayed with today’s date. How can I change that behavior to just show an empty cell, like every other data type does that has NULL values?

    Thanks! I am SO close to finishing this project!

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Contributor Kim L

    (@kimmyx)

    Hi @donkiely,

    Thanks for letting us know!

    This looks like a bug. I’ll inform Peter about this so he can take a look.

    I’ll let you know once we get an update. 😊

    Great work on your project! It’s coming along nicely. 🙌

    Thread Starter donkiely

    (@donkiely)

    Hi Kim,

    Any word on an update? Or is there a workaround? We’re getting close to being ready to go live, and this is the last issue we need to resolve.

    Thanks!
    Don

    Plugin Contributor Kim L

    (@kimmyx)

    Hi @donkiely,

    Apologies for the delay!

    Peter is currently focused on working on the new version of WP Data Access, hence the lack of update. 😞

    Essentially, SQL doesn’t accept NULL values in date fields whenever there are updates to the table.

    In Data Forms, you can use environment variables as Default Values, and you can add custom variables using hooks, but I haven’t tested this yet. 😔

    See here: WordPress user ID in SQL | WP Data Access

    I’ve sent another message to Peter in case he has a better suggestion or a fix.

    We appreciate your patience as always! 🙏

    Thread Starter donkiely

    (@donkiely)

    Thanks, Kim. But your answer confuses me. I’m not looking to provide a default value for a field in a table. I’m only reading the data, and my relatively sparse data has a lot of NULLs for date fields. When those fields are displayed in a list in WPDA, they are displaying today’s date.

    Instead, I want those NULL values to display as empty cells, as it does for every other data type.

    And how would I use a WordPress user ID to solve this problem?

    So I’m not sure how I would use default values as you describe. What am I not understanding?

    Your mention of hooks sounds intriguing. Am I able to hook into the reading of date fields somehow to pass a ” for NULL date fields?

    Thanks for nudging Peter again!

    Don

    Plugin Contributor Kim L

    (@kimmyx)

    Hi Don,

    Apologies for the confusion! I was looking into setting a default NULL or empty value if the old data is already null to prevent the form from prefilling it with the present date. 😵

    But I have good news! Peter was able to fix this issue along with other issues reported by others. It’ll be available in the next update and he’s planning to push it live sometime this week. 🤗

    Thank you so much for waiting. 🙏

    Let us know if you have other questions!

    Thread Starter donkiely

    (@donkiely)

    Thanks, Kim! That’s great news. I appreciate you and Peter making that happen!

    Thread Starter donkiely

    (@donkiely)

    Just wanted to confirm that the latest version fixed the problem. Thanks again!

    Plugin Contributor Kim L

    (@kimmyx)

    Hi @donkiely,

    Thank you for the confirmation! 🙏

    We appreciate your patience as well!

    Feel free to message us or create a new thread if you have new questions. 😊

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘NULL Dates in Row Appear as Today’s Date in Data Form’ is closed to new replies.