Forum Academy Marketplace Showcase Pricing Features

Saving multiple input fields into a list of addresses

So I have the following popup for input:


All of those input fields are inside a group and the type of content is set to “Shipping address”

My database setup is set up like so:

The workflow is setup such that, when I click “Save shipping” (not shown in the screen shot) in the shopping cart popup, it triggers a custom event:
image

And that custom even is setup like so:



However when I try to run it, none of the input data is making it into the workflow:

If I were trying to get this to work from a repeating group, I know how to get that to work but because this is a group with a bunch of input fields, I’m not sure what I am missing.

Also, I know that I could just skip the nested nature of my database setup and just have the shipping addresses be a list of things right in my user database but from a bunch of tutorials I have watched, setting up the nested db structure seems to be a more robust way of doing things and I would like to do it that way.

Any help would be much appreciated.

By looking at what you screen shotted, I don’t believe the parent group that these input fields are in has any relation to the data in the input boxes, even though they share the same type.

What’s the data source of the parent group? Is there a custom state that the parent group and the input fields share? They have to be bound to each other in a sense for this to work

Thanks for your help Anthony.

Currently the data source isn’t set to anything. I’m very familiar with what this should be set to if it were a repeating group but given that is a regular group, my understanding is that the “content type” and the “data source” are there to show what the group should display, not to allow access to another part of my app of what is in the input fields, but please, correct me if I’m wrong.

So the data source actually does control what data a workflow can see

If you don’t have a data source, but have a type and you refer to your “Group Shipping Info” it will populate the fields correctly because you’ve specified the type (address 1, 2, city, country etc) but it will return blank, because the group has no data to display.

Ok great. So is the way to fix this just to properly set the “type of content” and “data source”?

If so, are you able to advise what I should set them to?

What I would actually do is just create the shipping address information directly from the input fields data, and disregard the group. It is much easier and does not involve using custom events. It is also much easier to troubleshoot when your app grows

When the save button is clicked, create a new shipping address with values from the input boxes
Address 1 = input address 1’s value
Address 2 = input address 2’s value
City = input City’s Value

then as you did in your current workflow, the next step would be to make changes to the current user and assign them that address

This still allows for your object-oriented or “nested” design you were talking about earlier

That is so much easier. Thanks so much.

1 Like