Passing data from datatable to python script in a local machine using with Uplink

I have built a table that contains Company name, Username and Password. In the main screen using drop down list when I select the Company name it shows also the Username and Password selected for that row into different labels.
I want to pass these two label values using Uplink to my local machine python to be able to execute a login script code to a webpage.
I have to use python in local machine because of the script i have built.
In Anvil i wrote the code(provided by the tutorials):

def __init__(self, **properties):
    self.init_components(**properties)
    self.drop_down_1.include_placeholder = True
    self.drop_down_1.placeholder = "Choose a company..."
    self.drop_down_1.selected_value = None
    self.drop_down_1.items = [(r['Compny_name'],r) for r in app_tables.profile.search()]
    row = self.drop_down_1.selected_value

def drop_down_1_change(self, **event_args):
    row = self.drop_down_1.selected_value
    user_varify = self.lbl_Username
    pas_varify = self.lbl_Password    
    user_varify.text = row["Username"]
    pas_varify.text = row["Password"]

Is it possible to pass the text containing Username and Password values to python using Uplink?
Thank you in advance

The password that’s stored in Anvil’s users table is hashed, so keep that in mind. But if your passwords aren’t part of the users service then it will be whatever you have. To pass that to an Uplink device you should set up your Uplink function just like a server module function by decorating it:

@anvil.server.callable
def some_function(username, password):
   #do something here

Then call the Uplink code from your server module:

anvil.server.call('some_function', username, password)
2 Likes