Form Scheduling According to User Meta Field

By: Dedi Thorne | Asked: 08/16/2024
ForumsCategory: Code HelpForm Scheduling According to User Meta Field
Dedi Thorne asked 1 month ago
So, I'm working on a site for a certification company.  Certifications are good for 5 years and require "x" amount of continuing education credits in that period to be renewed. I've got a working form for the current accredited users to enter continuing education credits and upload supporting documentation as they get them.  It's working on "Save Draft" with the ability to submit only once and not until they view a summary and certify that all is correct on it. I need this form to reset when their renewal date is updated.  This date varies widely among the current accredited members but I'm saving it in an ACF user meta field ( [user_meta key=renew_by] ).  It will also be updated automatically in their original formidable entry (application form) via zapier once their documentation and payment have been approved. Questions:
  •  Do Formidable draft "time out"?  I'd hate for someone to start entering CEUs and a year from now, everything they've entered is just gone.
  • Can I make a view that is specific to the logged in user ( ID )?
  • How can I force a form reset of the CEU entry form ( form id is 33 ) without losing previously entered information? 
    • I need it to reset on the 1st day after the user's "renew by" date. 
    • I need to have it hold the formerly entered information and start a new entry, even if that former information was still in draft.
  Thank you!
1 Answers
Rob LeVineRob LeVine answered 1 month ago
  1. Do Formidable draft "time out"? Answer: I can't think of a way that would happen. Do note, however, that the system only allows one draft per form per user.
  2. Can I make a view that is specific to the logged in user? Answer: Yes, see this.
  3. How can I force a form reset? Answer: You'll need a CRON job (or API maybe) to do it on a certain date. In the code that you call from the CRON job, you can make a SQL call to change the entry's status from draft to "complete" (though you might have to default some required fields). That would allow the user to create another draft at a later time. I'll be honest, that I don't know what you mean by reset. At the end of the day, it's possible.
Dedi Thorne replied 1 month ago

"Do note, however, that the system only allows one draft per form per user." - but they CAN "save draft" multiple times for that same entry, correct? It's been working like that on my end as an admin but I have not logged in as an accredited user to test that functionality.

By "reset", I mean that I need them to only be able to actually submit the form once in their 5 year period, but that the form becomes available for them again on day one after they renew their accreditation.

Thank you very much for pointing me in the right direction with the CRON job/SQL idea. I'll look into that as I do still have time to get it up and working before the site goes live for renewals.

By the way, are you for hire if I find I need custom code written? I've been lurking in the forums and have found that I appreciate what I've seen from you.

Rob LeVineRob LeVine replied 1 month ago

Yes, they can save their draft as many times as they want because it's still only one draft for one user. I now understand what you mean by reset, but I'm not sure how you plan to disallow them from submitting the form more than once in 5 years. There are many ways to do it, though I think they'd all involve custom code. You might want to look at this post -> https://connect.formidableforms.com/question/category/code-snippets/how-to-limit-submissions-per-time-period-once-a-month/

Yes, I'm available for hire to write custom code. You can email me at rolevine _at_ gmail.

Dedi Thorne replied 1 month ago

I'll play with these and save your email. Thank you!

Making the Best WordPress Plugin even better - Together

Take on bigger projects with confidence knowing you have access to an entire community of Formidable Experts and Professionals who have your back when the going gets tough. You got this!
Join the community
crossarrow-right