Links between the tables of your low-code application
Now we still need the option to cast votes. This could be done using a web form, but it seems a bit complicated if you have to open a web form just to select a value and then submit it. It is much quicker and easier to do this using a button. We assign the function Copy row to another table to this button. This function copies all columns with identical names. Create another column in the Votes table that corresponds to the name of the first column in the Feature Requests table .
button for voting
button for voting
Then click on the button and watch what usa rcs data happens. A new row is created in the Votes table , but the automatic link to the correct feature request is still missing. We do this with an automation rule that automatically creates a "link" to the first table for each new row. Test your app now by distributing a few votes.
Automation rule for automatic linking
Automation rule for automatic linking
Python script to remove duplicates
You will immediately notice that although we have now created a very simple way to vote, this does not prevent a person from voting for the same feature request multiple times. We naturally want to prevent this and use the following Python script for this purpose.
We attach this script as an additional action to the automation rule we just created, thus ensuring that duplicate entries are immediately removed. Try it out now. You will see that a new entry is created in the votes table, but it is immediately removed again.