Database not linking to related collection with submit

I have a simple app, where a question is posed and there are 2 buttons for Yes and No

My database collections are like this:
User
Question
Answer

Question and answer are linked, since many answers could be tied to one question but only one question for each answer.

I created a list to pose the question, then a Yes and No button underneath

Problem:
When I first test, it works intermittedly. Most of the time it’s not recognizing the ‘current question’ and recording that in the answers database, it just leaves that blank.

I cannot find where to ‘link’ the data for the current question so that it’s recorded in the answers record. Is there another way to do this?

Here is my list, which is a maximum of 1 since I only want one question at a time

I have a button here, but as you can see it doesn’t recognize the current question to update

Hi @zen_b,

Welcome to the community :partying_face:

I guess you have added the button on the simple list? That won’t work because you can’t access current item data when you add a new component on a simple list. So what you need to do is remove the simple list and add a custom list and then add the button into that custom list and you will able update with current question data!

Thank you

Initially that solution worked, however when I signed in as a different user, or hit Yes or No multiple times it did not show up with the correct question, see below:


So at first this solution worked great, but then it stopped working.

When I delete everything, re-add the custom list, and 2 button components, then it works again:

So does it works now or not?

It is sporadic. It is working as expected now, however a few days ago if I answered the same question with the same user multiple times, or logged in as a different user, it would not link the Question. I’m not sure the reason for it not working as I don’t see a pattern I can hone in on. For now I"ll say it’s fixed.