Skip to content

Commit

Permalink
Merge pull request #731 from philipp-c/bugfix-723-dependent-lookup-field
Browse files Browse the repository at this point in the history
#723 fixed issue by updating query parameter names
  • Loading branch information
vgrem authored Aug 28, 2023
2 parents 343a0a4 + a7523f3 commit 2c70c9e
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions office365/sharepoint/fields/collection.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,21 +108,21 @@ def add_text_field(self, title):
"""
return self.add_field(FieldCreationInformation(title, FieldType.Text))

def add_dependent_lookup_field(self, display_name, primary_lookup_field, lookup_field):
"""Adds a secondary lookup field to a field (2) collection.
A reference (3) to the SP.Field that was added is returned.
:param str lookup_field: Name of the field (2) from the target list (1) to include data from.
:param Field primary_lookup_field: Main lookup field to associate the dependent lookup field with.
A dependent lookup field will include data from the list item referred to from the instance of the main
lookup field.
:param str display_name: Title of the added field
def add_dependent_lookup_field(self, display_name, primary_lookup_field_id, show_field):
"""Adds a secondary lookup field to a field collection (target).
Args:
display_name (str): title of the added field in the target FieldCollection.
primary_lookup_field_id (str): ID of the main lookup-field in the target to associate the dependent lookup field with.
show_field (str): name of the field from the source list to include data from.
Returns:
Field: reference to the SP.Field that was added.
"""
return_type = Field(self.context)
self.add_child(return_type)
parameters = {
"displayName": display_name,
"primaryLookupField": primary_lookup_field,
"lookupField": lookup_field
"primaryLookupFieldId": primary_lookup_field_id,
"showField": show_field
}
qry = ServiceOperationQuery(self, "AddDependentLookupField", None, parameters,
None, return_type)
Expand Down

0 comments on commit 2c70c9e

Please sign in to comment.