The BIG one. Help needed, please!


#1

Hi guys. Good evening. So, I am stuck on logic for a database source query.

PROBLEM 1:
I have 2 tables, 1 table holds the “data of the user”, the second table holds his “trust score”. In order for this user to connect with other users, they want to see his trust score.

So, I have a database source query for “User Data” and another database source query for “User Trust Score”. I create a repeat region with “user Data” and it displays all the user requests, now I want to associate the users “Trust Score” to the repeat records of “User Data”. So that the user who views all the request from other users can also see their individual trust score.

My Not-Working Method:
I created “Trust Score” database source query, then for ID to filter, I used the $index of database repeat region “User Data”. This didn’t work. It shows only one user trust score and displays this on all other users showing from the user data repeat region.

Problem Number 2:
When user one sees all the trust score and decides on who he wants to connect with, he clicks “Connect” This triggers a database update record behavior “Create Connection”. However, this button and actions are in a repeat region. So when a user clicks “Connect” on the last record, it connects with the first record and not the last record.

In summary, how do I associate an action within a repeat a region for just only the #selectedindex of the record?

I will appreciate any and all help. Thanks.

PS: One last request, can anyone please point me to the doc or vide of how to create a Master Detail relationship on a single page with wappler? Can’t seem to find it.


#2
  1. If the two tables have a one to one relationship, it would have been simpler to have combined the two tables. If the two tables have a one to many relationship, you can combine the two as a query. See here for more https://www.youtube.com/watch?v=XlVb2nP7kck

  2. Bind a form to the Connect button and pass the ID of the chosen user to the Create Connection action step.

Supplementary.
See https://www.youtube.com/watch?v=wjs1oyfwaMQ&t=66s


#3

@pa ben. Thank you so much! That was a breeze. I didn’t try it twice. I really appreciate this.