# unable to update lookup column in dynamic crm 365 with cdata python connector

**URL:** <https://community.cdata.com/t/unable-to-update-lookup-column-in-dynamic-crm-365-with-cdata-python-connector/1135>\
**Category:** CData Drivers\
**Tags:** sql, question, connector, dynamics-crm\
**Created:** [July 22, 2025, 6:58am UTC](https://community.cdata.com/t/unable-to-update-lookup-column-in-dynamic-crm-365-with-cdata-python-connector/1135 "2025-07-22T06:58:00Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![phuvi2132](https://avatars.discourse-cdn.com/v4/letter/p/48db29/32.png) [@phuvi2132](https://community.cdata.com/u/phuvi2132)\
**Post date:** [July 22, 2025, 6:58am UTC](https://community.cdata.com/t/unable-to-update-lookup-column-in-dynamic-crm-365-with-cdata-python-connector/1135/1 "2025-07-22T06:58:01Z")

</div>

import cdata.dynamics365 as mod

conn\_str = (  
&nbsp; &nbsp; ‘OrganizationUrl=[https://dddddd.crm4.dynamics.com](https://dddddd.crm4.dynamics.com);’  
&nbsp; &nbsp; “OAuthSettingsLocation=/home/ddddddv.txt;”  
&nbsp; &nbsp; ‘InitiateOAuth=REFRESH;’  
&nbsp; &nbsp; ‘Edition=Sales;’  
&nbsp; &nbsp; ‘IncludeLookUpLogicalName = true;’  
)

conn = mod.connect(conn\_str)  
try:  
&nbsp; &nbsp; cursor = conn.cursor()  
&nbsp; &nbsp; cursor.execute(“”"  
&nbsp; &nbsp; &nbsp; &nbsp;UPDATE table1&nbsp;  
&nbsp; &nbsp; &nbsp; &nbsp; SET colum1 = ‘sdsdds0299e3’&nbsp;  
&nbsp; &nbsp; &nbsp; &nbsp; WHERE A = 110 AND B = 0  
&nbsp; &nbsp; “”")

# Get column names from description  
&nbsp; &nbsp; columns = [col[0] for col in cursor.description]  
&nbsp; &nbsp; print(“Columns in gfwi\_projects:”)  
&nbsp; &nbsp; for col in columns:  
&nbsp; &nbsp; &nbsp; &nbsp; print(col)

finally:  
&nbsp; &nbsp; cursor.close()  
&nbsp; &nbsp; conn.close()

column 1 is a lookup column which refers to column 2 of table 2. when i run the python query. there is an error : column1 could not be updated. This column is read-only. please help

---

<div class="post-metadata">

**Author:** ![PratikV](https://sea3.discourse-cdn.com/cdata/user_avatar/community.cdata.com/pratikv/32/1301_2.png) [@PratikV](https://community.cdata.com/u/PratikV)\
**Post date:** [July 23, 2025, 12:19pm UTC](https://community.cdata.com/t/unable-to-update-lookup-column-in-dynamic-crm-365-with-cdata-python-connector/1135/2 "2025-07-23T12:19:01Z")

</div>

​ @phuvi2132 &nbsp;,

Thank you&nbsp;for reaching out to us.

As per the error message, it appears that the column you’re attempting to update is read-only, which is why you’re encountering this issue. Could you please verify whether the column is indeed set as read-only?

Additionally, we noticed that you’ve enabled the IncludeLookUpLogicalName property. When this property is enabled, any lookup logical name fields should appear with the \_lookuplogicalname suffix. However, this suffix doesn’t seem to be present in the current output.

> **[CData Python Connector for Microsoft Dynamics 365 - IncludeLookUpLogicalName](https://cdn.cdata.com/help/LJK/py/RSBDynamics365_p_IncludeLookUpLogicalName.htm)**
>
> CData Python Connector for Microsoft Dynamics 365 - RSBDynamics365 - IncludeLookUpLogicalName: Indicates if the referenced entity name for a LookUp field should be exposed.

For further assistance, we recommend reaching out via email to **[support@cdata.com](mailto:support@cdata.com)**. This will allow us to gather the necessary details and provide more targeted support to help resolve the issue effectively.

---

<div class="post-metadata">

**Author:** ![phuvi2132](https://avatars.discourse-cdn.com/v4/letter/p/48db29/32.png) [@phuvi2132](https://community.cdata.com/u/phuvi2132)\
**Post date:** [July 23, 2025, 12:33pm UTC](https://community.cdata.com/t/unable-to-update-lookup-column-in-dynamic-crm-365-with-cdata-python-connector/1135/3 "2025-07-23T12:33:15Z")

</div>

HI ​ @PratikV &nbsp;,

Thankyou for the respond, i checked , the lookup columns doesnt have any read-only setting. that’s typical lookup column in crm dynamic 365.&nbsp;  
do you have any example with the update for the lookup column ?  
i dont understand what should i do with this “any lookup logical name fields should appear with the \_lookuplogicalname suffix”

---

<div class="post-metadata">

**Author:** ![Ethem\_Q](https://sea3.discourse-cdn.com/cdata/user_avatar/community.cdata.com/ethem_q/32/1997_2.png) [@Ethem\_Q](https://community.cdata.com/u/Ethem_Q)\
**Post date:** [July 24, 2025, 1:33pm UTC](https://community.cdata.com/t/unable-to-update-lookup-column-in-dynamic-crm-365-with-cdata-python-connector/1135/4 "2025-07-24T13:33:31Z")

</div>

Hi ​ @phuvi2132

First, to find out if the fields are read-only or not in the IsReadOnly field you can run a _SELECT \* FROM sys\_tablecolumns WHERE TableName = ‘TableName’._

In regards to the update failing for lookup columns that is because typically Lookup properties are computed, read-only properties that have an Edm.Guid value. Lookup properties make use of the following naming convention: **\_\<name\>\_value**. Can you confirm if that is the case with the column you are trying to update?

To change the value of a lookup property, you must change the single-valued navigation property that it represents. Kindly check the following documentation for more information:&nbsp;[Web API navigation properties - Power Apps | Microsoft Learn](https://learn.microsoft.com/en-us/power-apps/developer/data-platform/webapi/web-api-navigation-properties#lookup-properties)

By default, navigation properties are not included in the list of columns. To retrieve the list of navigation properties, set IncludeNavigationProperties=true&nbsp;in the connection string.&nbsp;Kindly refer to the following documentation for more details on this property:&nbsp;[CData Python Connector for Microsoft Dynamics 365 - IncludeNavigationProperties](https://cdn.cdata.com/help/LJK/py/RSBDynamics365_p_IncludeNavigationProperties.htm)

_Note that you may see the \_columnname\_value query example in the above documentation, but this seems to be outdated. Therefore in your insert/update statement you should use the Single-valued navigation property \<name\>instead of the Lookup field \_\<name\>\_value._

If you keep having issues with this I recommend reaching out to the CData support team ([support@cdata.com](mailto:support@cdata.com)) with more details and one of our support specialists will further assist you.
