Hyperlink text within repeating group

I have a database set up called “recommendations” that lists off different health tips for people. I currently have a page setup that shows those recommendations in a repeating group.

I have a subsection within the main repeating group on the page called recipes where I want to show multiple recipes (if there is a value(s) in the database). I was going to create a field (multi-list) called “Recipe” and another repeating group to list these recipes off (which is fine). However, I want to be able to link each individual recipe to the actual recipe URL on xyzfoodblog.com.

48%20PM

Obviously , there needs to be some kind of relationship between the recipe name and URL and it needs to be in a repeating group, but I’m not sure how to do this. Thanks!

Hi @alex.pethick - have you tried using the “Link” element? I just happened to have a test app with Data Type called “Recipe” so I added a “Recipe URL” field. Then the Link element in the RG shows the current cell’s Recipe URL. Not sure if that’s what you’re looking for?
tx
Nikolai
My Site
My YouTube Channel

image

Hi Nikolai, thanks very much for the response.

I have not been using the link element, but am I able to use that in a repeating group? I need a repeating group as each of my sections have a different amount of recipes

Thank you!

Hi Alex - yes you can add the link element in a RG. In the screenshot you’ll see it says “Current cell’s Recipe’s Recipe Name” in the text field and “Current cell’s Recipe’s Recipe URL” in the Destination URL field.

You just need to make sure you have a data field to hold the value of the URL for each recipe that has a URL. Then you can refer to it in the Link element inside the RG.

Nikolai, thanks for the help so far. I’m getting all confused about RGs - particularly when they’re nested inside other RGs.

I have create an editable public version of my page:
https://bubble.io/page?type=page&name=results&id=forum-public&tab=tabs-1

Towards the bottom of the page, I’ve tried to implement your solution inside the group “Nikolai suggestion”. You can see that I have a few variations - just trying to see what may work.

I think I’m struggling with database organization and how to use RGs within RGs within groups :slight_smile:

Can you shed some light on this for a noob? Thank you again!

Hi Alex - let me take a look.
tx
Nikolai

Ok, I looked at your design and you were close. I created and modified the “Nikolai suggestion” group - it’s in brownish/yellow group. I also modified “Nikolai suggestion” group (it’s now colored gray). Here’s my feedback:

  1. For the new brownish/yellow group, I changed the Group “Type of content” to “Recommendations” and the “Data source” to “Parent group’s Recommendations”. Reason you can do this is the big RG you have on the page has Type of content as Recommendations. And since Rec_recipes is a “child” of Recommendations in your data structure design, the “Data source” is simply that parent Recommendation.
    image

  2. Because of how the Group is setup in #1, the RG’s “Type of content” is simply “Rec_recipes” with the “Data source” being the “Parent group’s Recommendations’s List of recipes”. Note: You don’t need a “Search for” for the Data source since the data for Rec_recipes is specific to the “parent” Recommendation. Hopefully that makes sense but let me know if not. You had the text field setup correctly in the RG
    image

  3. Database design - You have “List of recipes” in “Recommendations” as a “List of Rec_recipes” which is good. The issue I found is that for the values of “List of recipes” in the database - the fields were empty so I needed to manually add them. Once I did that, things worked. So when you create a new “Rec_recipes” entry (ie create new Workflow Step), you need to add that newly create Rec_recipes to List of recipes in Recommendations.

For the next comments, I don’t recommend this approach but added it so you can compare contrast. It’s not as elegant a design and with the Search in the RG, it’s also a performance hit (granted your users may never really notice - but if you get large user base and database entries they could)
4) For the other Group (the original one in gray) I got it to work without changing the Group’s “Type of content” (I left it as “Rec_recipes”) You can see I needed to add a “:first item” that’s because the Group is within a cell of the big RG you have for the page with “Recommendations”. Since a RG is a for a list of things, I needed to select the first item in that list.
image
5) For the RG, I needed to do a search for the Data source to get the right List of recipes associated to the Recommendations. You can see the criteria I needed to add; the unique id of the “parent” Recommendations needs to equal the unique id of the Recommendation used by the “child” Rec_recipe. Again, not the recommended approach.

image

Hope this was helpful and made sense. Let me know if you need clarifications.

The logic for the group is there. The only logic I think is missing the one mentioned in #3.

For testing, I recommend creating 2-3 (at least) Recommendations with even more Rec_recipes. Then I’d have some Rec_recipes unique to a Recommendation and then also a use-case to test when Rec_recipes are shared across Recommendations. This will help build confidence that the data structure design is correct and the logic is working.

Best wishes
tx
Nikolai

1 Like

WOW. Thank you - what an awesome, generous answer. I’m been slowly digesting and implementing it.

The issue I found is that for the values of “List of recipes” in the database - the fields were empty so I needed to manually add them. Once I did that, things worked. So when you create a new “Rec_recipes” entry (ie create new Workflow Step), you need to add that newly create Rec_recipes to List of recipes in Recommendations.

This was the key. But, I am not going to use a workflow to dynamically add data. It’s all just stored answers and I’m going to find a way to show/hide a section (e.g. whole grains) depending on whether they scored high on a particular question. So, I was wondering if there was another way I could link an entry from “Recommendations” to “Rec_recipes” without needing to enter a unique ID.

I was trying to use a label system e.g. Recommendation entry is about Whole Grain Foods and then I enter/search for that label on the rec_recipe entry to link the two. Is that possible? Doesn’t seem to be working with my current config

Rec_recipes entry

Recommendation entry

Hi Alex - glad it was helpful.

If I’m following you correctly you’ll want the following:

  1. Each “Recommendation” is going to have a “List Label” value (looks like only one value the way your data structure is currently setup).
  2. Each “Rec_recipe” will also need to have a similar “List Label” value (again only one value per current data structure design). You currently have it called “Recommendations” of type “Recommendation”. This won’t work because in #1 above, “List Label” is of type text and in “Rec_recipe” it’s of type “Recommendation”. They need to be consistent, ie “text”, in both “Recommendation” and “Rec_recipe”. Let’s assume you’ll create “List Label” of type “text” in Rec_recipe.
  3. There may be N-number of “Rec_recipe” in your database with the same “List Label” value, ie “whole_grains”
  4. Since you’re no longer using “List of recipes” in “Recommendation” you can’t use the brown/yellow Group I created. You need to use the gray one. And the RG in the gray Group will need the Search criteria updated to image below. Note the red text is because you need the “List Label” field in “Rec_recipe” to be created (when it’s created you’ll see it as an option when you click “More…”

That should get you there (once you have data in those fields - and they need to be identical between “Rec_recipe” and “Recommendations” or the Search will never find a match.
tx
Nikolai

This topic was automatically closed after 70 days. New replies are no longer allowed.