add feature return objectid

417
1
Jump to solution
08-20-2021 02:50 AM
StuartMoore
Occasional Contributor III

so ive created a Notebook that adds a record into a table but i want to add the results objectID to a variable but i can't figure out how to get it

this is my code that adds the record and prints the results but thats as far as i've got

    add_res = Hist.edit_features(adds = [hAdd])
    
    print(add_res)
    sub = add_res['objectid']
    print(sub[0])
{'addResults': [{'objectId': 437, 'uniqueId': 437, 'globalId': 'D8CCE07Bxx9B8', 'success': True}], 'updateResults': [], 'deleteResults': []}
0 Kudos
1 Solution

Accepted Solutions
StuartMoore
Occasional Contributor III

answered by own question....

sub = add_res.get("addResults")[0].get("objectId")

View solution in original post

0 Kudos
1 Reply
StuartMoore
Occasional Contributor III

answered by own question....

sub = add_res.get("addResults")[0].get("objectId")
0 Kudos