Hey @Sylvain
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:
- Create an integromat scenario.
- Search for and select the “Webhooks” module.
- Set it up.
- Copy the url they create for you to your clipboard.
Integromat is ready to receive data to this url.
Setup Webflow:
- Create your native Webflow form.
- Add the copied url to your forms action field.
- Change the form method to “POST”.
- Add an embed element within your form.
- Paste this into it:
<input type="hidden" name="member_id" data-ms-member="id"> - Publish your site.
- Go to the live site while logged in as a MemberStack member.
- Fill out the form and submit it.
- 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 ![]()
Get meta data for the currently logged in member
- Add another module in Integromat.
- Search for and select MemberStack.
- Select get a member.
- Use the member id submitted with the form to fetch that member from MemberStack.
- 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
- Add another module in Integromat.
- Search for Router, select Flow Control.
- Select Router.
- Open the filter on the first route.
- Set the conditions to check your meta data field for a value.
- On that filtered route path, open the empty module.
- Search for Webhooks, select Webhook response.
- Add
302to the Status field. - Tap on the add item link under the custom headers field.
- Add
Locationfor the Key field. - Add the full urls you’d want the user redirected to in the Value field.
- 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 ![]()