Working with returns from Python Functions?

I am trying to use a function I wrote in Python that connects to AD and pulls back specific user information for account creation. I know the function works correctly in python, but I am not able to get any of the return information to appear in a message box. UiPath does not throw any errors but does not stop running either. Below is the Function from python. Please let me know if any additional information would be of assistance.

from pyad import*
from nameparser import HumanName
from nameparser.config import CONSTANTS
from DAT_Automation_DEP.States import StatesL
import pyad.adquery

#Searching user in AD

def AD(UserName):
q = pyad.adquery.ADQuery()

attributes = [“cn”, “mail”, “st”, “telephoneNumber”],
where_clause = f"SamAccountName = ‘{UserName}’",

for row in q.get_results():
name = row[“cn”]
email = row[“mail”]
st = row[“st”]
ext = row[“telephoneNumber”]

#Parses name for initials
def initials(full_name):
if (len(full_name) == 0):

first_middle_last = full_name.split(" ")
for name in first_middle_last:
return initial

DATint = initials(name)

#Splits First / Last Name into own text values
Hname = HumanName(name)
Hname = Hname

FirstN = Hname.first
LastN = Hname.last

#Parses TQL Username from Email
DatUsrNameAD = (email.split(‘@’))
DatUsrName = DatUsrNameAD.pop(0)

return DatUsrName, FirstN, LastN, DATint, st, ext, email, name


Your function returns a tuple, not a string. It’s been a while since my last python/UiPath interaction but I used to serialize “complex” python object results (producing a json string) and deserialize them in UiPath with Newtonsoft.Json