Skip to main content

How can I efficiently populate 800+ form fields in Memberstack without manual entry?

Hello Everyone Hope someone can help 

I made a 2min video to explain. Need a way to enter fields better when its going to be in the 100s
Memberstack help can't help me even though it can be done, so hopefully someone in the community can help, pretty please 
https://capture.dropbox.com/oe62Bn5QCdmmOVBC

Thanks, James 

4 comments

  • Josh Lopez
    Josh Lopez

    Hey James Daniel

    Thank you for posting. For your use case I would suggest using member json to save a collection of guests instead of custom fields. There is a limit of 100 custom fields but no limit for JSON currently. This will require some custom coding though.

    0
  • James Daniel
    James Daniel OP

    Hey Josh Lopez thanks for getting back 

    Yeah thats what Memberstack said, I never coded for member.json before so don't know where to start. Would you know how to do this? I very good at knowing how to adapt and edit, it the start am lost with of how to add 

    If yes, can you help please?
    Thanks 

    0
  • Josh Lopez
    Josh Lopez Edited

    I personally can't help you with custom code unfortunately. We do have an active community on slack that may have someone who can help though. Doing a quick convo with our Rey ai I was able to get this info which should be a good start:

    To update a member's JSON data, including a list of guests, you can use the updateMemberJSON method provided by Memberstack's JavaScript (DOM) package. This method allows you to update the JSON data associated with a member's profile.

    Here's an example of how you might use the updateMemberJSON method to update a member's list of guests:

    <script>
    const memberstack = window.$memberstackDom;
    let memberId;

    memberstack.getCurrentMember().then(({ data: member }) => {
        if (member) {
            memberId = member.id;
            updateGuestList(memberId);
        }
    });

    async function updateGuestList(memberId) {
        const memberData = await memberstack.getMemberJSON(memberId);
        const guests = memberData.data.guests || [];
        const newGuest = {
            name: "Jane Doe",
            starter: "Garden Salad",
            main: "Ribeye Steak",
            dessert: "Chocolate Mousse"
        };
        const updatedGuests = [...guests, newGuest];

        const updatedMemberData = {
            ...memberData.data,
            guests: updatedGuests
        };

        const result = await memberstack.updateMemberJSON({ json: updatedMemberData });
        const finalMemberData = await memberstack.getMemberJSON(memberId);
        console.log(finalMemberData);
    }
    </script>

    In this example, we first retrieve the current member's JSON data using getMemberJSON. We then access the guests array from the member's JSON data, append a new guest object to it, and update the member's JSON data with the new list of guests using updateMemberJSON.

    0
  • James Daniel
    James Daniel OP

    Hello, Thank you Josh Lopez for the additional help, hopefully I can work it out or find a developer that can polish it off
    Have a lovely night :) 

    0

Please sign in to leave a comment.

Sitemap