It has been a while since I have posted, but this one has me stumped!
Background - I have a project system that tracks contracts associated with the selected project. Each contract is also associated with a type (ie. Labor, Material, Other, etc...).
The type (is a collection - colContractType) that gets built from a SharePoint List. And this I have no issue with. Collection gets built based on Filter() and I am using AddColumn() and ShowColumn() to reduce the number of columns in the collection.
What I am trying to do is this:
When you "Add" a new contract to the list from in colContractType, there is no item selected by default. I am using {} in the Default field of the Gallery that displays the collection. Alone this works perfectly.
But when I select a specific contact from the Gallery of Contracts, I set a variable (_contEdit) so the form is not blank, but it displays the current SharePoint list item for editing.
If(
_contEdit,
{},
LookUp(Contracts, Gallery1.Selected.ID = ID, contractType)
)
As a default value for the Property of the Gallery, I get an error ' expected a value compatible with items'
I would like to have the "Add New" show nothing selected and when in Edit Mode have the SharePoint Source Data value from the list shown.