Skip to content

The population of MultiLookup values for Sharepoint lists via the class FieldMultiLookupValue is not working #946

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
lealcastillo1996 opened this issue Mar 1, 2025 · 0 comments
Labels

Comments

@lealcastillo1996
Copy link

The population of MultiLookup values via the class FieldMultiLookupValue is not working in the most recent version. I am doing something wrong, also i tried the .executequery after the update and not working. Could you please send a working example, would be highly appreciated

indexes_look = dict_lookup_fields[field_name][index]  # List with the int IDs of the items to be added. 
                print(indexes_look) #: [1,2]
                if indexes_look and isinstance(indexes_look, list) and len(indexes_look) > 0:
                    field_value = FieldMultiLookupValue()
                    for lookup_id in indexes_look:
                        field_value.add(FieldLookupValue(lookup_id=lookup_id))

            
                    item.set_property(field_name, field_value).update()
                    ctx.execute_query()

And getting back
('-1, Microsoft.SharePoint.Client.InvalidClientQueryException', "Incompatible type kinds were found. The type 'Collection(Edm.Int32)' was found to be of kind 'Collection' instead of the expected kind 'Primitive'.", "400 Client Error: Bad Request for url: [https:...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants