I have a table in dataverse which has a lookup column. If I make a post without the lookup column, the data will be updated in the table, except of course the lookup column. My question is how do I update the lookup column as well? This is the script that I use
> > jsonlistdf = ['column1': '0000098778', 'lookupcolumn': '5187', 'column2': 'Lodon', 'column3': '8000'}
>
> conn = http.client.HTTPSConnection("{}.api.crm4.dynamics.com".format(url))
>
> headers = {
> 'Authorization': 'Bearer ' +accesstoken,
> 'OData-MaxVersion': '4.0',
> 'OData-Version': '4.0',
> 'Accept': 'application/json',
> 'Content-Type': 'application/json; charset=utf-8',
> 'Prefer': 'return=representation'
>
> }
>
> for i in jsonlistdf:
> data = json.dumps(i, default=str)
> response = conn.request("POST", "/api/data/v9.2/tablewithlookupcolumn", data, headers)
> res = conn.getresponse()
> data = res.read()
> print(res.status, res.reason)
I have understood that I need the GUID from the lookup table that the relationship has, but can't find any documentation how this should be done.