How to save AI-generated results to JSON using a button click instead of form submission? Answered

Post author
Daniel Haas

Hey guys! I had a quick question — is it possible to save data to a member’s JSON without using a form?

I’ve seen several MemberScript examples that show how to update or add JSON data via a form, but in my case, the content is dynamically generated by ChatGPT and displayed on the website (rather than input by the user).

I’m trying to build a “save” system where users can save individual results that are generated. You can check out what I’ve built so far at freetimely.com — my goal is to let users save specific AI-generated results to their MemberStack JSON.

Is there a recommended way to do this without relying on a traditional form submission? I’d really appreciate any guidance or best practices. Thanks so much!

Comments

2 comments

  • Comment author
    A J

    Hey Daniel Haas, its not necessary to have a form in order to store data to Member JSON. For example, this memberscript use-case of saving items is done by updating JSON whenever a user clicks on the save icon.

    It works for CMS dynamic items but for your use-case, you can build something similar by taking inspiration from the script, and fetching the content that you want to store via code and pushing it to JSON when user clicks to save their results or auto-save it based on your logic like when the results becomes available etc. Here's a base code for manipulating Member JSON, just in case.

    You can customize the script to work as per your requirement. Hope this gives you some idea.

    Feel free to reach out in the channel if you face any blockers during the implementation.

    0
  • Comment author
    Daniel Haas

    Great, thank you so much!

    0

Please sign in to leave a comment.