Referencing data within a repeating group from another repeating group

I’m building an admin panel. I want to show a list of the basic info for each user in a repeating group. If click on a button in a cell for a user then I want to display all the services that they have assigned to their account in a repeating group on the same page. That I can do.

Where I’m stuck is showing the corresponding notifications settings for each service they’ve chosen. I want the switch (icon sms on or icon sms off) to indicate whether the sms notification for that user and that service is set to on or off. I would do this using the conditions for those icons. Also, if I click on the “icon sms off” I want to add the user to the “user notify sms” within the Services Type.

In this effort I am using two data types: Users and Services as shown below.

I can’t figure out how to reference the data I need to set the conditions to display the “on / off” icons or to build the workflow to add or remove the user from “user notify sms”.

I’m missing some core concept here … thank you in advance for any suggestions.

2 Likes

(Edited after re-reading your setup)

Hey @dyl78,

Here’s how to do this:

First, I’m going to assume you’re using icons to have more control over color and size. Just in case, the Ionic Elements plugin installs a toggle element that works for yes/no values and would also work well here. But for now, I’ll respond for your existing setup

  • Put the service repeating group in a group. Let’s call it Group Selected User. Set the group type to User. When you click “show services”, use the “display data” action to send that cell’s user data to Group Selected User. The RG source can now be “parent group user’s monitored services”

  • If the icon is “icon sms off” by default, the element condition should read: "when current cell’s service’s users notify sms contains Group Selected User’s user > change icon to “icon sms on”

  • Workflow 1: When icon is clicked only when current cell’s service’s users notify sms contains Group Selected User’s user > make a change to current cell’s service: users notify sms remove Group Selected User’s user

  • Workflow 2: When icon is clicked only when current cell’s service’s users notify sms doesn’t contain Group Selected User’s user > make a change to current cell’s service: users notify sms add Group Selected User’s user

Let me know if you have any questions!


Gaby | Coaching Bubble

6 Likes

OMG I was SO close to figuring that out for myself. Thanks for pushing me over the hump!

I don’t think I need the “only when” statement do I? If the icon isn’t available to click then I don’t need to specify “only when” in the workflow right? I’m just clarifying to gain understanding of best practices and such.

I haven’t played with Ionic Elements. I was going to use Bubble’s check boxes but struggled and from reading forum posts things looked pretty convoluted. So I just tried the switch idea using icons as an alternative. Should I be investigating Ionic Elements?

You would need it since you’re using the same icon (at least, that’s what I assumed) to trigger either action. When clicked and user is in list, remove from list; when clicked and user is not in list, add to list.

That’s also why I included the element condition - to change the icon based on whether the user is in the list or not.

I think that you happened to pick a slightly more manual route, but absolutely nothing wrong with it. It does give you more control over the design of the icon. With that said, the toggles allow you to auto-bind to a yes/no field for the parent Thing, which would eliminate all workflows altogether! (In that case, place the toggle inside a group so that you can set the group type to User, and source to Group Selected User … giving the toggle a parent Thing).

3 Likes

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