Python function returns null?

Hello, Everyone

I’ve been this issue almost week. I really want to know what is the problem, please help me out!

I’ve got python script that handle with word proccessing. Given document file there are staff names. Below code is for find to staff names and looping for python dictionary(empList), if staff names found then append id to empty array(empID) . Below code is working fine in the python shell but problem is when i return empID to UiPath the response is null!

def getNames(filename=None):
    empList = {
        'name1': 'id1',
        'name2': 'id2',
        'name3': 'id3'
    empID = []

    doc = docx.Document(filename)
    paragraphs = doc.tables[1]._cells[1].paragraphs
    for i in range(len(paragraphs)):
        encoded_object = paragraphs[i].text.encode(encoding='utf-8')
        text = encoded_object.decode('utf-8','ignore')
        result ='[.]\w+', text)
        names = text[result.start() + 1: result.end()]
        for key, value in empList.items():
            if names in key:
    return empID

Hello Everyone,

I figured out the issue. Problem was my empList keys were cyrillic. UiPath doesn’t recognize cyrillic characters in python code.

Thank you.

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.