Are many-to-many relations supported?

Hi,

Both are possible but you would need to implement an “Assignment Table” concept, as the Status field and Assigment due date relate to a single employee on a single project.

If you just have a list of Projects on the Employee, and vice-versa, you have nowhere to store the status. You know the Employees on the project but you don’t know their individual status.

So you need to store this data somewhere. You could have a data type on project that has Employee and Status and one on Employee that has Project and Due Date. But to me that seems more complex that having it all on one assignment related to one Project and one Employee.

1 Like

OK, so the data model looks like this. It was definately an iterative development, so I might not do it this way were we to start again.

Question - text and images etc
List of Answers
List of Responses

Answer - text etc - possible Answers to the Question
Question
List of Users Who Responded

Response - this is essentially the Junction Table between Users and Answers
Answer Given
User

User
List of Questions Answered
List of Answers given
List of Responses made

1 Like

Thanks @NigelG. Data model really helps,

I forged ahead before seeing this and have reporting almost working without using API Workflows. Just can’t figure out how to stack rank results in a repeating group by a cell value that is different than the content type of the table. Details of data model and wf below:

Feature - text metadata like benefit, description, etc.
Segment - eg cars, clothes, etc.

Question - text, etc. Canonical set so each user gets presented w/ same Q’s based on survey’s subject
Segment
List of Features

Rating - create a rating synchronously when user answers Question
Question
List of Features - populate by looking up Question’s List of Features
Score - apply same score to each Feature in the List of Features for now

As long as I create a Rating as user moves along, I can immediately display results in a RptgGroup. Report needs to have one Feature per row, with average of all Ratings. I can do this by creating an RG w/ content type Feature, first cell looks like this:
Feature Name - do a search for all Features for the survey’s given Segment
Avg Score - construct via calculation: sum / count of all Rating’s Scores for current cell’s Feature

Works beautifully, The problem is I can’t sort the table by the Avg Score element in the first cell b/c RptgGroup content type is Feature (needs to be, so I can have one row per Feature). So, no stack ranking, which is primary value prop.

The only option I can think of is to have a new data type/junction table:
Feature Rating
Feature
Rating

But to do this I have to run an API workflow on the list of Ratings, AFTER all Q’s are answered, so user sits and waits for results. As mentioned, this takes 4-5 minutes (each Segment has ~100 features, each survey has 15 questions, each of which generates a Rating tied to a dozen or so Features).

Any ideas how to use calculations in a clever way to get a per Feature average score into the report table w/o using API workflow to create Feature Ratings and building the table off that new data type? Alternatively, any tricks for sorting the table by a cell element’s value rather than by criteria of the Content Type?

Yes, sorting by a derived value in a repeating group isn’t easy.

Current thoughts …

  1. Create the “Feature Rating” things when you select the question. So rather than create 100 things in the API workflow you create them as you go along, and only if they don’t exist already.

You then run a “make Changes to a list of things” on the questions features list to update the average score as you go along/

  1. Put the list of feature ratings on the user, so when you create the user you prefil a list, and when you add a feature you update all users’ feature list. You use this as a temporary store for you scores.

I like the idea, but how do you create multiple Feature Rating things w/o invoking an API workflow? User selects Question A, which has a List of (15) Features. I need to create 15 Feature Ratings–can’t use “make changes to a list of things” b/c there’s no “create if it doesn’t exist” option for that action…

You would need to use the API workflow in this scenario.

Just wanted to make sure to thank all of you, and especially @NigelG, for this incredibly useful perspective into Bubble’s previous “thought process” and how it evolved since then. I am currently working through whether and how to link data types in bubble, and this proved to be such a valuable resource. It’s not often that content that’s almost 5 years old proves so very useful, so thanks to everyone who contributed their time to teach newbies something.