Interactive buttons - help

I want your help with this
I have created a website, on the ID dynamic page, I have 3 tables that displays different details. Table 1 displays donation commintment by the user (Lets asume #User1)…
Table 2 displays matching contacts details that User1 needs to pay their donations to…
Table 3 displays to the receiving member (Lets asume #User2), details about User1

This is my problem with the tables above.
Table1

  1. I need an action button on table1 (button behavior should be as below
    a) When user1 promises to give donation, button on the table1 should be PENDING
    b) When user1 is been merged to pay user2 on table2, button on table1 should be MERGED
    c) When user1 has paid to User2, button on table1 should be PAID…
    Additionally… I think in the case of (c), user1 needs to be displayed with a button called #PAID so that after the user has clicked on it, the Status on table 1 would be PAID (as explained in ‘c’ above)… I need yur help with this as well…

If you help me with the above, I will be able to apply the proceedure in the rest of my tables… I am not too familiar with wixcodes, so please anywhere that may require coding in your explaination, please do make example for my understanding… Thank you so much

Hi,

You can use wix-data for that: https://www.wix.com/code/reference/wix-data.html.
Look at the fetch method, which provides access to your database.
According to the results, you can use $w (Wix Editor Elements ($w) - Velo API Reference - Wix.com) to change the button’s label. (specifically, for replacing a label of a button: Button - Velo API Reference - Wix.com).

The links I provided already includes coed examples. Feel free to ask more questions if you need.

Good luck,
Idan.