Skip to content

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

Closed
@lealcastillo1996

Description

@lealcastillo1996

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:...

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions