I have a button on a list detail page that opens an AirTable Form. I’m dynamically changing the URL to pre-fill the AirTable Form with the user’s info.
I’m wondering if I can do the same with the list detail page? For example, I’d want to pass the Record ID of the page into the AirTable Form as pre-filled.
Let me know if this makes sense… Thanks!
Please have a look on this Help Doc to check the options you can use to prefill your form: Custom Form - Softr Docs
I think I understand what you’re asking, and if so, it’s definitely possible. If you’re trying to pass the record ID into an embedded form, it’s pretty simple, and I have steps below. If you’re trying to pass the record ID into an outbound URL, though, that’s trickier and I haven’t figured it out yet, either. But here’s what I do have, if any of it’s helpful:
- First, you need to actually get the record ID of the page. This community post by @artur contains the JS code you’ll need to actually pull that information, and it should be inserted inside
script tags in Page Settings > Custom Code.
- If you’re sending this data to an external link, rather than an embedded form, what I think you need to do then is add an event listener that will a) take that record ID, and b) append it to the outgoing link. I found this Stack Exchange post that I think looks promising, but I haven’t been able to get it to work, so who knows at this point.
- If you’re instead sending the record ID to an embedded form, it’s a little different. This post (also by the awesome @artur) gives you a script for how to pass logged-in user data into an embedded Airtable. However, it’ll have to be modified a bit, because you’re trying to pass a record ID, rather than logged-in user data. Instead of using
window['logged_in_user']['softr_user_email'], you would instead use
recordId, which we collected in step 1.
- From there, you can use collect the record ID in Airtable; just be sure to name the Airtable field identically to how you labeled the referrer
As I said, I haven’t yet figured out how to pass the record ID into an outbound URL (if anyone has, let me know!), but if you’re trying to pass the record ID into an embedded form, then steps 1, 3, and 4 are sufficient. For the record, here’s how I set up a Tally form using the steps above.
- The hidden field I created to capture the record ID
Thanks @adalys for outbound link with recordId can you pls share what’s the scenario ? should be easy I think to add an ID