artur
August 13, 2021, 7:30pm
1
Some of our users wanted embedded Airtable Form with logged in user info
<script>
let airtableFormUrl = 'https://airtable.com/embed/shrr1bNRWSjmfmJJK8k??backgroundColor=red';
if(window['logged_in_user'] && window['logged_in_user']['softr_user_email']) {
airtableFormUrl = airtableFormUrl + '&Email=' + window['logged_in_user']['softr_user_email'];
airtableFormUrl = airtableFormUrl + '&Full%20Name=' + window['logged_in_user']['softr_user_full_name'];
}
document.write('<div class="w-100 text-center"><p class="h6"><iframe class="airtable-embed" src="'+airtableFormUrl+'" frameborder="0" onmousewheel="" width="100%" height="750" style="background: transparent; border: 0px solid #ccc;"></iframe></p></div>');
</script>
1 Like
@artur , I canât use this script. I have an error message âAirtable nâautorise pas la connexionâ. Any idea of the problem ?
Thank you.
artur
February 20, 2022, 11:06pm
3
@Virginie can you pls ping us on support chat so we can look into this error ? Seems itâs a generic one not specific to this script.
Is there a way to pass in Softr parameters like LOGGED_IN_USER:AT_RECORD_ID?
Attempting window[âlogged_in_userâ][âat_record_idâ] and some variants on that does not seem to work.
I am trying to use a tally form after user sign up and send tally form data to airtable records. However, its not adding to the existing user record but creating a new record. Need help
Suzie
March 7, 2022, 10:21am
6
Hello @shiizygy ,
Do you mean the Airtable Embedded form or form in Softr?
Suzie
March 7, 2022, 10:23am
7
Dear @ramureddy ,
Do you want the current record to be replaced when a new form is submitted?
Did I get right?
Hi Suzie, yes. thatâs right. current record to be replaced when a new form is submitted.
I am using that data for profiles
Thanks,
Ramu
I am referring to an Airtable Embedded form (as discussed in this thread).
Suzie
March 18, 2022, 11:59am
10
Hey,
It is not possible, unfortunately. A new record is being created when submitting a new form.
Sincerely,
You can save the Tally post datas in a other table and make an Airtable automation to update the record in the correct table.
Tell me if you need/want more informations about the Airtable automation.
Nick
March 22, 2022, 10:54pm
13
@artur Is there anyway to refresh page or a block after submitting a embedded form?
artur
March 30, 2022, 12:32pm
14
Hi Nick! As we donât have access to the embedâs content itâs very hard thing to do
artur
September 15, 2022, 2:46pm
15
@shiizygy the example you shared has wrong quote character. For it to work quotes need to be like '
and not like â
Also feel free to share the url so we can check it.
tom2
November 11, 2022, 2:34pm
16
FYI the query params in @artur âs script needs to have âprefill_â before each of the form field names as noted in the airtable docs here (maybe itâs been updated recently?).
Updated version here:
<script>
let airtableFormUrl = 'https://airtable.com/embed/shrr1bNRWSjmfmJJK8k??backgroundColor=red';
if(window['logged_in_user'] && window['logged_in_user']['softr_user_email']) {
airtableFormUrl = airtableFormUrl + '&prefill_Email=' + window['logged_in_user']['softr_user_email'];
airtableFormUrl = airtableFormUrl + '&prefill_Full%20Name=' + window['logged_in_user']['softr_user_full_name'];
}
document.write('<div class="w-100 text-center"><p class="h6"><iframe class="airtable-embed" src="'+airtableFormUrl+'" frameborder="0" onmousewheel="" width="100%" height="750" style="background: transparent; border: 0px solid #ccc;"></iframe></p></div>');
</script>
1 Like
If non of previous custom codes work, this one should work on React blocks
<script>
window.addEventListener('block-loaded-feature-grid1', () => {
if(window.logged_in_user) {
const name = window.logged_in_user.softr_user_full_name;
$("span:contains('{LOGGED_IN_USER:NAME}')").removeClass('d-none');
$("span:contains('{LOGGED_IN_USER:NAME}')").html(name);
}
})
</script>
1 Like
Hi,
Sorry to dig this up but very confused about how to implement this. I canât see how to change it for my airtable set up?