Select to view content in your preferred language

Exception: JSONObject["attributes"] not found.

738
1
Jump to solution
05-04-2023 06:27 AM
ColeHowell
New Contributor III

Exception is in the title. I'm trying to script automated updating of a hosted table in our portal service but when I go to add a new row this is what I get. Any advice? Relevant code is below.

    for meter in z_met:
        # print(meter)
        m = meter[:3]
        m = m.rstrip()
        # print(m)
        row = {
            "constrno2": m,
            "forward_flow": z_met[meter][0],
            "reverse_flow": z_met[meter][1],
            "date_": date.today()
        }

        if row["forward_flow"] == row["reverse_flow"]:
            row["status"] = 1
        else:
            row["status"] = 0

        print(row)

        table_layer.edit_features(adds=[row]) #where the exception is raised

 Also the error code from the server is 500 if that helps. 

0 Kudos
1 Solution

Accepted Solutions
ColeHowell
New Contributor III

Solution was I forgot to add the attribute key to the dictionary I was passing to the edit_features method.

View solution in original post

1 Reply
ColeHowell
New Contributor III

Solution was I forgot to add the attribute key to the dictionary I was passing to the edit_features method.