A good feature would be to set up the ability to prefill a form with current wp user data. This would allow the logged in user to have their name, email etc. included in the form.
Are you calling the form from a WP page? If so, you should be able to pass the values as part of the URL string using get_query_var(). (See this discussion, among others.)
If i put in a fixed text (e.g., John Doe) the name does fill in the name field. I came to the conclusion that I couldn’t pass WP user data but maybe I am incorrect.
I also added code to the functions.php file as follows…
The information on Airtable prefill (only for form views) can be found here. There are a number of caveats and tricks, so a search for ‘/prefill’ in Airtable Community may prove valuable.
I’ll be honest: All my WP-to-Airtable integration has been through @Chester_McLaughlin’s excellent Airpress WP plug-in. I’d stumbled across the reference to populating URLs using WP variables while researching options for a prospect who ultimately decided not to use WP,¹ so I’m afraid I’ll have to defer to the WordPress experts here…
…or Airtable, for that matter, because he’d evidently just been given an iPad and had decided not to use any software whose iOS implementation wasn’t a mirror image of its Windows and browser implementations. I sometimes wonder how well that principled stand has worked out for him…
And here’s the info on how to do it:
Yes, this is possible and doesn’t require Airpress to work. If you place the code below into your functions.php file you’ll have a shortcode that allows you to embed a form and prefill specific fields
When making an Airtable form, you can use prefill_ parameters in the URL of the form to prefill specific fields.
Find the URL for the form you wish to prefill.
Once you get the form URL, you can ...
Chester, I really appreciate the help but I remain stuck. I believe I have implemented the code as described above exactly as written but to no avail.
What I am getting is the ability to Prefill a fixed text field e.g., Prefill_name=John Doe and what I am looking to do is prefill the current wordpress user. Assuming this is possible there must be a syntax that I am missing.
While using a shortcode plugin like the one below may help you get access to the data you want (current username and email) there will still be a potential problem of spaces or invalid HTML characters.
I think the best approach is to code your own custom shortcode that outputs exactly what you want using PHP. Then you can have logic, defaults, and properly encoded data.
Hi there, I had previously requested some guidance on prefilling an Airtable form. I am getting close to abandoning this approach and coming up with something different. Before I give up though i will see if there may be something seemingly simple that I may be missing. I tried the “shortcodes ultimate” and it works perfectly but I can’t figure out how to get it into the Airtable field.
The standalone shortcode is [su_user Name=“display_name”]
However placing it in an iframe is where i run into the issue. I assume the syntax is incorrect but i have tried evey combination i could think of to get it to work.
Note the your@email.address comes out the way it is shown here. However that doesn’t help me because i want to vary those fields based on the logged in user.
Anyway, thanks again for any help you can provide.
Ed