Hi @nzl.lakshay,
Thanks for the extra details! I understand what you need to do. Now that I know more, I’d change the following in your database:
Instead of separate fields for smoothies and raw juices under the Cafe type, just have 1 field called “Drinks” which is a list of Drinks.
Then, under the Drink data type, add a new field called “Cafe” that is type Cafe.
Before you fill in the drinks menu, I would actually create the shop first. It’ll make things so much easier.
- Put the entire form inside a group. Set the type of content of the group to = Cafe
- Put the Drink Menu part in another group with type of content = Cafe, data source = parent group’s cafe
- Make the drink menu group not visible on page load (in other words, hidden by default)
- Add a condition to the drink menu group: “When parent group’s cafe is not empty > This element is visible (check the box)”
- Have the submit button above the drink menu group (outside of it)
- So, when page is first loaded, all you see is the top part of the form and the submit button
When Submit is clicked:
Step 1- Create a new shop
- Cafe Name = Input cafe name value
- Business Name = Input business name value
- Location = Input location value
- etc.
Step 2 - Display data to the Drinks menu group, data to display = Result of step 1
Now, the drinks menu will appear and is able to reference the cafe record.
Ok, now for the drink menu, instead of separate inputs/dropdowns for each drink, I would use a repeating group. Type = Drink, Source = parent group cafe’s Drinks (the replacement field I mentioned at the beginning).
Put a single input element and single dropdown element inside the repeating group cell. The dropdown Set the initial content of the input to “Current cell’s drink name” and the initial content of the dropdown to “current cell’s drink’s type”
At first, this repeating group will be empty, so have a button somewhere to “Add a Drink.”
When “Add a Drink” is clicked:
Step 1- Create a new drink > Cafe = parent group cafe
Step 2 - Make a change to parent group cafe > Drinks add result of step 1
Now, trigger workflows when the input and dropdown inside the RG are changed.
When Input’s value is changed:
Step 1- make a change to current cell’s drink > name = this input’s value
(same for dropdown for type)
Now you can add an infinite number of drinks.
THE END!
Gaby at Coaching No Code Apps (formerly Coaching Bubble)
Courses & Products, Tutorials, Private Coaching, and High-level Development
Start Learning Today 