I’m using gform_pre_render to pull in data to my form from an API and prepopulate fields.
This works great.
Problem: It’s a multipage form, and whenever the user navigates to a new page in the form the API requests are made again, pulling the same data redundantly and slowing everything down.
How can I avoid the API request running more than once?
I’ve played around with adding a css class of ‘updated’ to the form, but this is cleared when the user navigates. I’ve also tried setting a field value in the form to ‘updated’ but don’t know how to read the value during pre_render to avoid it hitting the API.
Any input would be appreciated, thanks guys!