Foreign key record

Hello,
I am a beginner in bubble.
I am stuck on a problem of foreign key registration in a database.
I have two tables: a questionnaire table and a question table.

image1078×624 65 KB

As you can see, in the questionnaire table, I have the list of questions that will be used to filter my questions according to the questionnaire.
Unfortunately, instead of saving the index of my questions in my list, I save the index of my questionnaire.
I show you how I set up my workflow.

Creating my question record

updating the question record

When I display the indexes, they are good.


Maybe there is another method to record my foreign keys?

Thanks for your help.
Christian

Hi Cristian!

As I saw, after you create a new question, you add this question to the question’s list of the selected questionnaire .

It is not working? What is the issue?

Thank you for your interest in my problem.
As you can see, below. I show you the content of the questionnaire table.
In the field “question_list”, I should have the index of the questions. But instead, I find the indexes of the questionnaires.

I would like, by selecting a questionnaire, to view the questions of this questionnaire

Thank you for your help
Christian

This is very odd… do you mind to share your editor so I can take a look?

Anyway, I saw that you are already saving the questionnaire as a data inside the question. So there is no need to add the question to a list inside the questionnaire.

If you want to see the list of questions of a specific questionnaire just do a “Search for” the questions where the questionnaire field is equal to the one you are looking for…

Hello,
Thanks for your help.
I’m still in free version so I can’t share my editor. However, I can send you the application.
For your proposal to filter on the questionnaire index in the question is a good idea. I will try it. It will allow me to make progress.
But I would have liked to know why it is not the index of the question that is recorded but the index of the questionnaire.
I think that the answer is certainly in the structure of my groups that I don’t know well.
Merci

If you want me to take a look, just send me the credentials in private! :+1: It will be nice to help…

1 Like

Thanks to rpetribu who found my mistake
I take back his message.

<<Found the problem. Everything was correct. The problem was that, in your database, you selected to display your questions using it’s questionnaire’s uniq_id instead of use the question’s uniq_id.>>

image|autoxauto

Changed to “uniq_id”. So you are good to go!

1 Like

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