Form Submission redirect to Dyanmic URL using Memberstack Metadata

Hi,
I have been searching the forum and everywhere to find if someone had a solution to add a dynamic redirect URL to a form.
I need to dynamically redirect to the CMS created after form submission.

I use memberstack where users that submit the form are already signed in.


Then redirect to http://www.mysite.com/workshops/workshop-name

I think it is doable with some custom code. BUT I don’t know how to code that :smile:

I have been looking around and my idea to solve this long time requested feature would be to Memberstack using the meta.data

My idea is to use Memberstack to store the Slug Url when a teacher submit a workshop name, he will be redirected to the workshop CMS page.

I have tried to come up with a custom code, but it’s probably not correct (I don’t code, remember :slight_smile:)

indent preformatted text by 4 spaces
<script>
MemberStack.onReady.then(async function(member) {

	if(member.loggedIn){
		
	const metadata = await member.getMetaData();

  	metadata.workshops = metadata.workshops || [];
const slug = "Workshop CMS slug"

Webflow.onReady.then(function(member) {
if(CMS item is ready){
window.location.replace'https://www.yourdomain.com/workshop/'+ $('#slug').val();
}else{
setTimeout(function() { location.reload(true); }, 3000);

}
})
});
</script>
indent preformatted text by 4 spaces

Let me explain what I am trying to do in plain english

When form #Workshop-submit-name is submited
Then redirect to https://www.yoursite.com/wait-redirect

and when Meta data “Workshop CMS slug” is found in Memberstack
then redirect to https://www.yourdomain.com/workshop/workshop-name

else
reload page and try again redirection after form submission to work.
In what I see, the community has been stock on this one for many years.

Any one can help me get this
Thanks in advance


Here is my site Read-Only: LINK
(how to share your site Read-Only link)

Hey @Sylvain :wave: this is totally doable. Here’s how…

I suggest taking that logic out of Javascript and moving it into a free Integromat.com account.

Setup Integromat:

  1. Create an integromat scenario.
  2. Search for and select the “Webhooks” module.
  3. Set it up.
  4. Copy the url they create for you to your clipboard.

Integromat is ready to receive data to this url.

Setup Webflow:

  1. Create your native Webflow form.
  2. Add the copied url to your forms action field.
  3. Change the form method to “POST”.
  4. Add an embed element within your form.
  5. Paste this into it: <input type="hidden" name="member_id" data-ms-member="id">
  6. Publish your site.
  7. Go to the live site while logged in as a MemberStack member.
  8. Fill out the form and submit it.
  9. Go back to your Integromat scenario, it should show that it received the form submission.

Webflow is now sending form submissions directly to Integromat with the currently logged in members id.

Part 4 from my quick screencast walks you through setting both of those up :rocket:

Get meta data for the currently logged in member

  1. Add another module in Integromat.
  2. Search for and select MemberStack.
  3. Select get a member.
  4. Use the member id submitted with the form to fetch that member from MemberStack.
  5. The response will contain the meta data you’re looking for.

https://docs.memberstack.com/endpoints/members-1#get-member (tap the response tab).

Redirect based on member data

  1. Add another module in Integromat.
  2. Search for Router, select Flow Control.
  3. Select Router.
  4. Open the filter on the first route.
  5. Set the conditions to check your meta data field for a value.
  6. On that filtered route path, open the empty module.
  7. Search for Webhooks, select Webhook response.
  8. Add 302 to the Status field.
  9. Tap on the add item link under the custom headers field.
  10. Add Location for the Key field.
  11. Add the full urls you’d want the user redirected to in the Value field.
  12. Repeat the above for the second redirect based upon meta data.

Based upon the value in the members meta data, they’ll be redirected to the correct page.

NOTE: Even easier, just add the full url you’d like them to be redirected to within MemberStacks meta data and you don’t need the Router module :sunglasses:

1 Like

Wow Great,
Thanks @ChrisDrit
I will try that right now. Integromat is required or can it be done with Zapier?
I currently use zapier for other automations, if I can stick to that, it would be better.
Let me know
Thanks

Hi @ChrisDrit

It’s working well.
Now I am wondering if I should switch to integromat :slight_smile:
I just have a problem, it seems that the hidden fields are not send to integromat. Do you know where that can come from?

Thanks for your precious help

:+1:

The amount that you get for the price is unbeatable.

When you setup your Webhooks, you can set it to be super restrictive in regards to what fields are allowed to be posted to or, or leave it unrestricted, meaning allow any fields to be posted to it. Double check those settings.

Thanks for the quick reply @ChrisDrit

I don’t think I have any restrictions and still, I cannot see hidden fields.

I send only Hidden fields, and Output is empty. Am I missing something?

The only thing I need to figure out, and I am about to cancel Zapier for Integromat :thinking:

Yea, a couple of things…

In your screenshot find the “Data structure” field. You have a data structure selected, I’d recommend leaving that blank as the helper text suggest (this is what I was referring to in my last comment). I’m thinking they are not coming through because of this.

Also, check those 3 checkboxes below the Data structure field for better debugging.

If none of that works, then we need to go back to the Webflow Designer and look at your form. If this is the case, post your read-only link please.

@ChrisDrit
Thanks for the quick reply
I have tried to remove the data sctructure and click the 3 boxes


Nothing new

Here is a screen record, if you can spot something that is not proper

Thanks for your help

One last thing on Integromat you could try is to make sure you click that “redetermine data structure” button.

Other than that somethings up on the Webflow side. Would need the read-only link to figure it out for you.

@ChrisDrit

I have done “redetermine date structure” but nothing new

here is the read only link

Page to look at is “Workshops Template” in CMS Collection Page

and the intogromat link

Let me know if you see anything
Thanks

Okay I see what’s up :smirk:

Your hidden form fields are wrong. Here’s the first of your hidden fields (the rest are basically the same):

<input type="hidden" ms-data="webflow-member-id" data-name="Webflow Member ID" />

Here’s what a legit hidden form field would like:

<input type="hidden" name="webflow-member-id" ms-data="webflow-member-id" data-name="Webflow Member ID" />

The difference is the name attribute within the hidden form field :nerd_face:

I created a quick test Webflow project with a form and setup Integromat. Removed the name attribute from my hidden form field and indeed it won’t show up in Integromat.

This makes sense, it’s not a valid HTML field without that name attribute.

Update all of your hidden fields to include that name attribute, try it again, and then let me know…

That works!
Genius, Thank you so much

Now I will implement the Dynanic redirect, but everything should work perfect.

Thanks again

1 Like

Hi @ChrisDrit
I have been implementing my zaps into Integromat.
I have a problem replicating sending Multi items into a multi-reference field

I was using the Rollup field from Airtable and send it too webflow using Webhook by Zapier.
Just like here https://youtu.be/AIbSEa6KqYI?t=744

But now in Integromat, It seems that is not possible, or needs to be done differently.
Do you know how I can send items into a multi-reference field using integromat

Thanks

@ChrisDrit
No worries, found it!

Just need to use HTTP module PATCH

All working now!
Thanks again for your precious help

Best
Sylvain

1 Like