OK, the first thing I did was to format the code using indents and the code sample displayer "</>":
If(
LookUp(List Name1, //(updated phases details list)
GlrPhases.Selected.GlrPhaseSprint = SubPhasesName &&
GlrPhases.Selected.GlrPhaseProjectName = ProjectName.Value &&
GlrPhases.Selected.GlrPhaseName = PhasesName.Value,
GlrPhases.Selected.GlrPhaseName = PhasesName.Value
),
ForAll(GlrPhaseWise_3.AllItems,
Patch(List Name1, //(updated phases details list)
LookUp(List Name1, //(updated phases details list)
PhasesName.Value = GlrPhasewisePhaseName &&
ProjectName.Value = GlrPhasewiseProjectName &&
CheckItem = GlrPhasewiseCheckItem &&
SubPhasesName = GlrPhaseWiseSubPhaseName
),
{
SupportingDocuments: supp.Text,
Observation:obs.Text,
Status: Dropdown4_3.SelectedText,
RAGStatus: LblPhaseWiseRAG_3.Text,
CompletionDate:
If(Dropdown4_3.Selected.Value = "Closed",
DatePicker3_6.SelectedDate,
""
),
PlannedCompletionDate: DatePicker3_7.SelectedDate,
Sequence: GlrPhaseWiseSequence,
Score: score.Text,
'Compliance status': Dropdown4_4.SelectedText
}
)
),
ForAll(GlrPhaseWise_3.AllItems,
Patch(List Name1, //(updated phases details list)
Defaults(List Name1),
{
ProjectName:
{
Value:
LookUp(List Name2,
ProjectName = GlrPhasewiseProjectName,
ProjectName
),
Id:
LookUp(List Name2,
ProjectName = GlrPhasewiseProjectName,
ID
)
},
PhasesName:
{
Value:
LookUp(ListName3,
PhaseName = GlrPhasewisePhaseName,
PhaseName
),
Id:
LookUp(ListName3,
PhaseName = GlrPhasewisePhaseName,
ID
)
},
SubPhasesName:
LookUp(ListName4,
Title = GlrPhaseWiseSubPhaseName
).Title,
CheckItem:
LookUp(ListName5,
CheckItem = GlrPhasewiseCheckItem
).CheckItem,
SupportingDocuments: supp.Text,
Observation:obs.Text,
Status: Dropdown4_3.SelectedText,
RAGStatus: LblPhaseWiseRAG_3.Text,
CompletionDate:
If(Dropdown4_3.Selected.Value = "Closed",
DatePicker3_6.SelectedDate,
""
),
PlannedCompletionDate: DatePicker3_7.SelectedDate,
Sequence: GlrPhaseWiseSequence,
Score: score.Text,
'Compliance status': Dropdown4_4.SelectedText
}
)
)
);
Perhaps this happened when you inserted comments, but there were 4 or 5 critical syntax errors (missing commas, extra parenthesis) that should've resulted in Power Apps displaying errors. I think I caught all those. This format helps when reviewing nested records too.
The very first problem is the condition on the main If() statement. The condition is simply a LookUp() and should be showing an error - this needs to be an expression that evaluates to true or false. If you are trying to test whether a record exists using that LookUp, then you should evaluate its return value using the IsBlank() function to return a true or false.
Second, I noticed the same LookUp() at the start of the code has a mixture of && and separate lookup arguments - is there a reason for this?:
If(
LookUp(List Name1, //(updated phases details list)
GlrPhases.Selected.GlrPhaseSprint = SubPhasesName &&
GlrPhases.Selected.GlrPhaseProjectName = ProjectName.Value &&
GlrPhases.Selected.GlrPhaseName = PhasesName.Value,
GlrPhases.Selected.GlrPhaseName = PhasesName.Value
),
I suggest correcting those issues before going further into the functionality of the code.
Bryan