Sharepoint list update
![ashwinivatsa](https://us.v-cdn.net/6038231/uploads/Dataiku/nAvatar20.png)
How to update a column of an existing SharePoint list item.
There are 95 list items on a SharePoint list, and a process runs to compare data from one of the columns of each list item with a database table and only update a column "Lower?" of the list items for which the values are lower than the database table values.
Operating system used: Windows
Answers
-
Grixis PartnerApplicant, Dataiku DSS Core Designer, Dataiku DSS ML Practitioner, Dataiku DSS Adv Designer, Registered Posts: 72 ✭✭✭✭✭
Hello @ashwinivatsa
From your short description, it seems that you want to update the "Lower" column of existing SharePoint list items where certain conditions are met (in your case, where values are lower than those in a database table), you would need to set up a scenario that includes a Python recipe or Python custom step for comparaison to interact with the SharePoint list via the SharePoint plugin and your dataset from database
I guess with a python custom step for make in first a Sync first from your existing list item in your flow and after a comparaison yith your dataset like this kind of example
# Make your comparisons sp_df[lower_column] = sp_df.apply( lambda row: "Yes" if row[sp_column_to_check] < db_df.loc[row[sp_id_column], db_column_to_check] else "No", axis=1 )
For resume, the scenario's process could be,
- Retrieve Sharepoint List Items (fetch via dss plugin)
- Retrieve your database dataset
- Python compare code recipe
- Update sharepoint list item ( as a sync conditioned by your comparaison result)
May you should test this process, especially the API update and retrieve calls, and ensure proper error handling is in place.
https://www.dataiku.com/product/plugins/sharepoint-online/
https://github.com/dataiku/dss-plugin-sharepoint-server