Streaming live at 10am (PST)

Add slug or cms data to form submissions

Is there a way to add slug or cms data to form submissions? We are going to implement a general form on a dynamic page, and it would be nice for the client to see which page the form is coming from.

1 Like

Yes, possible. Implement the form, then ask again with share link AND published link.

Ok, cool.
I know you have to publish share link, but form was not done, and I wanted to explore different options before selecting form approach. We have made a simple webflow form on the page now.

Here is the share link:

And link to page with form:

Paste this in Site Settings > Custom Code > Header Code:

function getParam(name) { name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]"); var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"), results = regex.exec(; return results === null ? "" : decodeURIComponent(results[1].replace(/\+/g, " ")); }

Paste this in Page Settings > Custom Code > Footer Code:


Now, this link will populate first field with value “test”:

Hmm…not sure if I explained my challenge good enough. I want form submissions from these dynamic pages to include “slug” or some other CMS data so that form entries can be handled correctly by client.

So data from this specific page could be:
Name: Tom Hansen
Phone: 995 56 856
Comment: Bla bla bla
Page: Strafferett

Where “Page” is the dynamic data. Client will then know what kind of area the customer is interested in.

Just add an embed code with a link/button and dynamic variable like this. (hide the referrer field if you don’t want to display it to the user).

Otherwise, JS can also grab the referring page automatically using location.referrer.

Thank you @samliew. I will give it a go.

I actually thought of a simpler way to do this. I just added a dynamic embed to the form and a hidden input field with dynamic value. The dynamic embeds usually solve it :slight_smile:

<input type="hidden" name="Fagfelt" value="(Slug / dynamic value)">

It seems you have the solution to my problem, but I can’t make it work. I don’t see a way to make a hidden input field with a dynamic value. Is there not a way to directly call a CMS field content for the value?
In your example: "input type=“hidden” name=“Fagfelt” value=“(Slug / dynamic value)” Can I not directly enter the CMS field in question?
In case I’m not making sense: I simply need the form to submit the page name along with the form content (the purpose are applications).
Many thanks,


The code is input into an html embed which is added inside the form block. Replace the value inside the quotes “” with the slug or name from the CMS.

Hope that helps.


Add a HTML Embed inside the Form component.
See screenshot.


Add a dynamic field inside the “hidden” input field in the HTML Embed, and give it a proper name.
See screenshot.


Good luck!


Thanks very much to both @matthewpmunger and @biodust - It worked! (I wasn’t aware of the “Add Field” option in the HTML Embed Editor.)
Funny enough, the value returns only the first word of the form content (e.g. “Manager” for the field content “Manager Corporate Development”) - however, it works with the slug which is good enough for me!
Thanks again & cheers,

1 Like

Awesome! Glad it worked out.

Hey, did you ever come around to figuring out how to get the whole field into the value? i only get the first word of the form content as well lol.

Thanks in advance.

Unfortunately not, sorry.

And how can you take that data to the Email subject? please help

@mao what type of form solution are you using. Webflow’s native or Zapier or other?

native forms… Client won’t use zapier for some reason…:man_shrugging:t5:

To get a value of more than one word, put quotes around the custom field. Worked for me :slight_smile: