Is it possible to create a dynamic custom code block?

Hi there,

I have a set of e-learning modules that I want my users to be able to access. Each module corresponds with a unique Typeform. I was able to embed a single typeform into a list detail page but was wondering if it’s possible to make a custom code block dynamic so that each list detail page renders a different Typeform?

Put more simply, my desired functionality is as follows:

  • The homepage has a list of the different e-learning module names (referenced from Airtable)
  • When a user clicks on any list item, they’re taken to the relevant list detail page
  • The specific list detail page has the corresponding Typeform embedded (since each module has a different Typeform associated with it, this Typeform will be unique to the list item clicked)

Would greatly appreciate any help with this. Thank you!

Hey @SamEasy, can you please let me know which data you want to pass to your Typeform from the List Details block when making it dynamic?

Hi Marine, thanks for your response!

I’d like to pass the Typeform ID.

So I’d like the following behaviour:

  • The list detail page (note each e-module topic has a different page) has a custom code block that contains embed code for a Typeform
  • I want that Typeform to be fed the appropriate Typeform ID (pulled from my Airtable that has a different Typeform ID for each e-module)
  • I also want the Typeform to be passed a hidden field for email address (based on the logged in user’s email address)

I was able to find previous community threads that mention how to pass a hidden field to a Typeform. However, I don’t know how to do this within list detail page that is also pulling in the Typeform ID from my Airtable. Really appreciate the help!

Dear @SamEasy, thanks for the clarification. You will need to use the following custom code to pass the logged-in user data to your form: How to pass logged-in user data to embedded typeform

Regarding passing the Typeform ID, you will need to modify the shared custom code.

@SamEasy what you shared above is possible by using the links Marine shared and putting the code as a formula in Airtable in order to get typeform IDs too.