human
get field by name nil on missing.
assistant
Here is a Python program to get field by name nil on missing fields

import json

def get_field_by_name(d, name):
    """
    Get field by name nil on missing
    """
    try:
        return d[name]
    except KeyError:
        return None

# Enter the dictionary
d = {"a": 1, "b": 2}

# Calling the function
print((get_field_by_name(d, "a")))

#Example Output
# 1

#Remember to inspect code for bugs.