Forum Academy Marketplace Showcase Pricing Features

Confused about data and sources and convoluted 'code'

I’ve set up some data and workflows, and while they work, there are some parts that don’t seem right…

I have a table called Skills that links a Skill to a User and gives the link a Skill Value (how competent the user is) Skills are an option set.:

skill table

I then have a User Group, Repeating Group of Skills (option set), a Skill Name, then a Slider inside a Skill Group to set the Skill Level:

Group: User

Repeating Group: Skills

Text: Current Skill Name
Group: Skill

Slider: Skill Level

Skill level is auto-bound to the record in the Skill Table, and I have a workflow to create new entries in the Skill Table when the User has not yet selected a Skill Level for that Skill. This all works perfectly, but the ‘code’ to do it is quite convoluted and does not seem right.

To update the Skill Table, I use the following ‘code’ when the Skill Level Slider’s value is changed from Null:

Skill Level = This Skill Level Slider Input’s Value
User = Current User
Skill = RepeatingGroup Skill’s List of Skills:item #Current cell’s index :roll_eyes:

Why do I need to use the index number of the cell to do it in a long winded circular fashion? Surely I should be able to use something like the following, but it’s not available:

Skill = RepeatingGroup Skill’s #Current cell’s Skill

Am I doing something wrong, is is that the expected behaviour?

There are so many ways to set up what you are doing in bubble. Can you post a link to your editor so that we can see exactly how you have set up all of your elements and workflows?

Thanks!

Everything looks good. There is a different way to do it as well but it adds more complication to the workflow. Basically instead of auto-binding the slider input you would have to make the slider input’s default value the search for skills and manually handle the saving of the slider position every time it was changed. This would allow you to make the slider’s parent group type, the parent element type (repeating group type) and you could pass the parent element to the create a new skill, copmetancey workflow.

Thanks so much for your help - I guess if it works it works, it just seems really odd.

You’ll run into a lot of things like that. Bubble is no code built by coders for people who know nothing about coding. Weird is normal here, but it works and it’s fairly easy to build with.

Hi @SJL,

It looks like you’ve done a bit of refactoring around “Competency” since marking this “solved”. However, if I understand the question correctly…

 

You don’t.

 

It seems to me you could simply do…

Skill = Parent group's Skill

 
Again, this assumes Competency was Skill before your recent refactoring.

Or did I misunderstand the question?

-Steve

EDIT

Upon closer inspection, it appears the changes are basically what @StarrK_Designs suggested. :+1:

Thanks @shot - the method you suggested would work normally, but I need to cater for non-existing values in the Skills (now called Competencies) Table, and the Parent Group’s Skill is null in these cases. Otherwise that method works fine for updateing existing values.

I actually managed to resolve this elegantly in the Bubble way, by wrapping my data in another group to bring the grandparent values down. This is exactly the same as what I had to do with Group: User to bring the User details in (but for some reason did not think of it here).

Group: User

Repeating Group: List of available Skills (Competencies)

Group: Competency (current cell’s Competency) ← this is new

Group: Skill (searches my Skills Table for entries)

Slider: Skill Level (for selecting skill values and saving to the Skills Table)

Doing this, I was able to refer back to Group: Competency to get the values I needed when saving new entries into the Skills Table:

Thankfully, knowing the Bubble way will really help when my site starts to need more nested values and Index is not going to work

1 Like