Different types of data in repeating groups

Is it possible to have different types of data in repeating groups?

I’m creating parts which I need to be sorted by drag and drop. I want to be able to create repeating groups parts like this

mulititext
image
multitext
video
multitext
etc…

What is the best way to accomplish this? Thanks.

  1. Create a new table in the database. We’ll call it “Thing”. It should have the following fields:
  • multitext - yes/no (default = no)
  • image - yes/no (default = no)
  • video - yes/no (default = no)
  1. The repeating group’s data source should be "Search for Things.

  2. In the repeating group’s cell, you should have 1 group that contains 3 other groups. The 3 groups shouldn’t be visible when the page is loaded.

  • Group 1 will container a multitext input and only be visible when “current cell’s multitext is yes”
  • Group 2 will container an image and only be visible when “current cell’s image is yes”
  • Group 3 will container a video and only be visible when “current cell’s video is yes”

Make sense?
Daniel

5 Likes

@alex10 I think @dbevan’s solution is the way to go here. There’s one tweak you might consider if you need to simplify your database a bit. Rather than having a yes/no field for each possible type that your object could contain (which is a perfectly viable solution), you could have one text field, called “Type”

Per @dbevan’s example, group 1 would only be visible if current cell’s Thing’s Type is “multitext”, group 2 would only be visible if current cell’s Thing’s Type is “image”, etc. This route could be useful if you end up having more types then multitext/image/video and don’t want to maintain several yes/no fields. It also prevents the potential for more than one group within the cell to be visible at once.

Happy Bubbling!

David
AirDev - Custom Software for Everyone

1 Like

@dbevan, @david2 Thank you very much!

I’m testing this right now. Quick question, so the way I understand it it will work like this

  • Repeating group - data source should be "Search for Things.
    • main group
      • multitext group 1 - this element is visible on page load is disabled
        • multitext visual element
      • image group 2 - this element on is visible page load is disabled
        • image visual element
      • etc…

The issue i’m running into is I only see “Current cell’s …” option on the main group and I don’t see it on the group 1 and group 2. I’m probably missing something simple or doing something wrong? Thanks!

@alex10 Ah I forgot about that! Can you make group 1 / group 2 / group 3 inherit from the parent group’s data source? Then your expression would be “Parent group’s Thing…”

If you don’t want to be required to make your groups the same data type as the repeating group cell, you can just place a hidden group somewhere in the cell that inherits the parent group’s thing. Then the conditionals on your groups would reference this hidden group, like so: “Hidden group’s thing’s type is…”

Lmk if I can clarify any of this!

@david2 When you say inherit, do you mean in data source make it “parents group’s thing”? I don’t see inherit, I think I’m missing something.

@alex10 Yeah exactly, make the data source “Parent group’s thing” - that’s what I mean by inherit

@david2
I have it set like this right now

  • Repeating group - data source should be "Search for Things.
    • main group - data group set to “Current Cell’s things” and element is visible on page load is checked
      • multitext group 1 - data group is set to “Parents groups things” this element is visible on page load is disabled
        • multitext visual element - dynamic is set to “Parents groups things type is multitext”
    • image group 2 - data group is set to “Parents groups things” this element is visible on page load is
      - image visual element - dynamic is set to “Parents groups things type is image”
  • etc…

but for some reason its showing me 12 empty cells, which is the number of entries in the things type in db. I think i’m just doing something wrong.

@david2 I’m going to play around with it, I’m just doing something wrong. I’ll let you know if I have any questions. Thanks again for your help!

Any updates on this?