Hello all! I’m currently building a combination CMS/LMS in Softr, and there’s one issue I’m running into: adding a text editor to the app so that users are able to create their own content . I tried a couple of different methods (such as embedding an HTML editor like TinyMCE into a code block), but ran into issues with being able to pass logged-in Softr user information into the editor. Eventually, I landed on the following solution:
- Adding an HTML Editor widget (Squire Editor) to Jotform
- Embedding the Jotform into my Softr app via custom code block
- Using this methodology to pass logged-in user data into the embedded Jotform
- Finally, using a Jotform automation to pass that information back into Airtable, so I can link the data to the logged-in user.
However, I haven’t been able to successfully execute step 3 (passing my user data to Jotform), and I’m wondering if anyone can spot my error. Here’s my code (currently in a custom code block in Softr):
<script>
let jotformUrl = 'https://form.jotform.com/jsform/220770379464058';
if(window['logged_in_user'] && window['logged_in_user']['airtable_record_id']) {
jotformUrl = jotformUrl + '&record_id=' + window['logged_in_user']['airtable_record_id'];
}
document.write('<iframe src="' + jotformUrl + '" width="100%" height="500" frameborder="0" marginheight="0" marginwidth="0" title="My Application"></iframe>');
</script>
I’d then like to pass that record URL into Jotform, but I’m a little more unsure about the methodology. Here are my Jotform settings:
I’ve updated the unique name of the hidden field I’d like to use to collect the URL, but I’m running into trouble, and I can’t find documentation that outlines exactly what I’m trying to do. Can anyone tell me where my error is?
(As an aside: another option I tried is to use this script to add the current user’s recordId into the URL, and then use the Jotform “Get Page Form’s URL” widget to collect the url, but I haven’t been able to get that script working, either. So if anyone thinks that method might be simpler, I’d love to get insight into what might be possible there).