I have an app that i've been working on for a while. The app is connected to a SQL database. The app has 3 screens. First screen is a gallery of "Groups" or companies. OnSelect of a group, you are navigated to another gallery screen with a list of the available "Pipelines" assigned to them. OneSelect of a specific pipeline, you are navigated to the last gallery screen with a list of the "Stages" the selected pipeline. There are 8 stages for each pipeline. Each stage has a date and comment field that are editable and OnChange make a Save button visible.
On the StageGalleryScreen, each gallery item is a different stage from 1-8. Each stage when edited (OnChange) will need to Patch at least 1 table and possibly 2. The Stage Type table has an additional column named "EndStage". This column is a check box (bolean true/false).
I'm working with a total of 3 tables here, but only need to patch 1-2 of them. For the formula of the OnSelect of the save button, I have this formula written.
Set(SelectedDateValue, StageDateDatePicker.SelectedDate);
Patch('[dbo].[tblPipelineStages]', ThisItem, {StageDate: SelectedDateValue}, {Comments: StageCommentsInput.Text});
Patch(
'[dbo].[tblPipeline]',
If(LookUp(
'[dbo].[tblPipeline]', ID = PipeLineGallery1.Selected.ID)) && If(LookUp('[dbo].[tblPipelineStageTypes]', ID = StageGallery.Selected.PipelineStageTypeID && EndStage = true)) , {DateFinished: SelectedDateValue}); Refresh('[dbo].[tblPipelineStages]');UpdateContext({VisibleVar:false})
This section of the formula above is giving me an error:
Patch(
'[dbo].[tblPipeline]',
If(LookUp(
'[dbo].[tblPipeline]', ID = PipeLineGallery1.Selected.ID)) && If(LookUp('[dbo].[tblPipelineStageTypes]', ID = StageGallery.Selected.PipelineStageTypeID && EndStage=true)) , {DateFinished: SelectedDateValue});
The error says: The function "Patch" has some invalid arguments: Invalid number of arguments: received 1, expected 2 or more
I could use help writing this formula correctly. I'm guessing i have something out of order, or i guess i can't use the double lookup or i'm trying to do it incorrectly.
Any and all help greatly appreciated.
Take care,
Sean