def find_boolean_function(lib_json_data, port_name):
    """
    Search for a boolean function for a certain port in a .lib.json file.

    :param lib_json_data: json data of a .lib.json file
    :param port_name: The port name
    :returns: The boolean function as a string. Empty string if no boolean function was found.
    """
    if lib_json_data is None:
        return ""
    if ("pin,"+port_name) in lib_json_data:
        if "function" in lib_json_data[("pin,"+port_name)]:
            return lib_json_data[("pin,"+port_name)]["function"]

    return ""