How to properly implement ms-code attributes to save form inputs to JSON? Answered

Post author
Karolis Vaiginis

Is there someone who can help me with saving form items to JSON?

I have trouble with forms. I use one form in my onboarding, that holds a couple of questions and fields/checkboxes for answers. I inputed the code in Body tag, that should let json do its job, I put attributes on the main form child
ms-code="form1" ms-json-type="group" ms-code-json-list="DNA1"
And on each text input I put attributes of
ms-code-json-name="name" ms-code-fill-group="DNA1"
When I eventually save the form, it doesnt save changes to JSON

https://preview.webflow.com/preview/monkeflow2?utm_medium=preview_link&utm_source=desi[…]&pageId=673f1e9c5c888060abffd098&locale=en&workflow=preview

here's also a link of this page, maybe you'll understand the problem clearer

Also, I cant find of how to put information into json from checkboxes, but thats another problem

Comments

2 comments

  • Comment author
    A J

    I can see that custom code lines from 113 to 166 are not a part of the memberscript that you are using for the json use-case. Did you get it from any memberscript / was it own custom code?

    The issue lies in that custom part of the code since its not letting the form submit as per memberscript automatically and takes a manual approach. You could comment out those lines and just keep the relevant memberscripts and see if it updates the JSON correctly and then you could try to introduce the custom lines one by one to see what breaks the flow exactly.

    0
  • Comment author
    Karolis Vaiginis

    okay, I actually found what was the problem. I used ms-json-type="group" as one of the attributes, when the attribute should sound like ms-code-json-type="group"

    0

Please sign in to leave a comment.