How to update Webflow CMS from Memberstack custom field changes while filtering out JSON updates? Answered

Post author
Saptharishi Suresh

hey team

I've a Webflow form to update certain custom fields (non-JSON fields) in Memberstack. It is working fine.

Now I want to update the Webflow CMS in parallel using a webhook.
How can I do that? Do I need to use Javascript for this or shall I mention a webhook in Form -> Action parameter?

Kindly advise

Thanks
Saptha

Comments

4 comments

  • Comment author
    A J

    Hey Saptharishi Suresh, you can setup a workflow in Make / Zapier which listens to member updated event, so the module in Make would be 'Watch Updated members'. This will listen to updates done on the member which you can further utilize to update Webflow CMS fields. This free template uses a make workflow for similar use-case.

    You can setup a filter to only go through this route if particular custom field is updated to avoid using operations in other cases. Another approach could be to use platforms like Whalesync if that makes sense for your projects.

    Hope this gives you some idea.

    0
  • Comment author
    Saptharishi Suresh

    hi AJ
    Yes, I've been using this exact setup so far but without the filter. And my operations got exhausted. 

    Wondering if there is a way to filter the operations for only Custom fields and exclude operations for updates on JSON items?

    In other words, I want to watch update events for only the custom fields and not JSON fields.

    Kindly suggest

    0
  • Comment author
    A J

    Saptharishi Suresh, there are multiple ways to approach this.

    • One way to deal this would be to introduce a hidden field in that form which denotes that the custom fields have been updated and you can filter the workflow to see if the type of update (as denoted by the hidden field) is custom fields and if yes, continue with the flow and make sure to reset the value of this custom field at the end of the workflow so that it doesn't trigger loop in the workflow. You could also check if the fields in webflow CMS and the custom fields are different, if yes then proceed with the workflow.
    • Another approach could be to not update the custom fields via profile form on the site and instead have the form linked to the workflow via a webhook and then have the workflow update both memberstack custom fields and webflow CMS via that workflow.

    You can take whichever approach that suits for your project and explore that. I hope this gives you some idea.

    0
  • Comment author
    Saptharishi Suresh

    I tried your first approach, created a custom field with the custom attribute data-ms-member = "custom-field" but it seems not changing the flag properly. I'm using the below code:

    document.addEventListener('DOMContentLoaded', function() {
    var customInput = document.getElementById('hidden-custom-fields');
    customInput.value = 1;
    }

    I solved the issue by following this code snippet
    https://docs.memberstack.com/hc/en-us/community/posts/19508571444251/comments/19508587939611

    0

Please sign in to leave a comment.