Repeating group to show data from 2 different data types

Hi there,

I am struggling to combine 2 different data types, “Store” and “Task”, in the same repeating group.

Data type “Store” has a field called StoreName - text and a field called “StoreRegion” - text
Data type “Task” has a field called TaskDone? - yes/no and a field called ForStore - Store

The repeating group lists the names of stores for which a specific task needs to be done. I want to be able to filter this list by the store region. So when I choose a region from the dropdown element, I want the repeating group to only show the stores from that region. I cannot get the dropdown to apply to the repeating group.

I’d appreciate any tips or help. Thank you!

Hi! :wave:

  1. Change the Type of your RG to “Store”.
  2. Do exactly what you are doing in the “Data Source” field, but complete the request with:

Search for Tasks's ForStore Unique Elements

This shoud work!

Hi, thanks for taking the time to check out my problem. When I change the RG to Store, Bubble says I should change it back to Task if I do a search for Task:

I agree the challenge lies in accessing a data type field that belongs to Store while the repeating group’s type of content is set to Task. I chose Task for the repeating group’s type of content and also for the cell (data source is Current Cell’s Task) so that I can show the open tasks for each store (Parent group’s Task’s ForStore’s Store).

Now, I also want to restrain this store list by region, depending on the region selected in the dropdown. Is there a way to configure the data source of the repeating group to search the Store date type for region while the RG’s type of content is Task? The Task data type has a field ForStore - Store and I tried the following but do not know how to complete the expression or if this is correct in general.

I’d appreciate any feedback you may have, thanks!

Hi @al11 !

What you are doing here is correct. This is a little confusing at the beginning…

There is no problem in the Type of content be a “Store” and you start your Data Source with Search for tasks.

The RESULT of this sentence must be a list of stores (as this is the Type of content of your repeating group). So, at this point, Bubble will tell you that something is wrong, because your sentence is resulting in a list of tasks, correct?

So, to correct this nehavior, we need to END this sentence with a list of stores.

We know that every task has its own store. So, what you need to do is load these stores after your Search for tasks.

In the image above, keep scrolling down until you see something like Each item Store. This will load the store of each task instead of load the task itself. And this is what we want.

Search for task’s Each item Store :Unique elements

The :unique elements in the end is just to prevent duplicate stores in the results.

hi @rpetribu :wave: Thanks so much for clarifying. I managed to input the expression, but when I preview the repeating group it now appears empty. I am not sure what I am missing?

Perfect.

So, what is the problem now?

The groups inside your repeating group cell have the Type of content set to “Task” (my guess here).

And note that you have a text field, inside this group, trying to load the “Parent group’s task ForStore’s StoreName”.

You need to change this group’s Type of content to Store (current cell store) and change the call from your text field to “Parent group’s StoreName”.

1 Like

All solved, thanks a lot for you help! :pray:

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