Switch( Text(ThisItem.Frequency),"Quarterly",If(IsBlank(LookUp(colRowMonthData, 'Objective ID' = ThisItem.'Objective ID').ResultJan.Text),
If(
ThisItem.Unit=(Unit.text),
ThisItem.'Result jan t',
If(IsBlank(ThisItem.'Result jan'),ThisItem.ResultJanX,ThisItem.'Result jan')
),LookUp(colRowMonthData, 'Objective ID' = ThisItem.'Objective ID').ResultJan.Text),"Monthly",If(IsBlank(LookUp(colRowMonthData, 'Objective ID' = ThisItem.'Objective ID').ResultJan.Text),
If(
ThisItem.Unit=(Unit.text),
ThisItem.'Result jan t',
If(IsBlank(ThisItem.'Result jan'),ThisItem.ResultJanX,ThisItem.'Result jan')
),LookUp(colRowMonthData, 'Objective ID' = ThisItem.'Objective ID').ResultJan.Text),"Yearly", If(IsBlank(LookUp(colRowMonthData, 'Objective ID' = ThisItem.'Objective ID').ResultJan.Text),
If(
ThisItem.Unit=(Unit.text),
ThisItem.'Result jan t',
If(IsBlank(ThisItem.'Result jan'),ThisItem.ResultJanX,ThisItem.'Result jan')
),LookUp(colRowMonthData, 'Objective ID' = ThisItem.'Objective ID').ResultJan.Text))
textinput onchange property:
If(
CountRows(Filter(colRowMonthData, 'Objective ID' = ThisItem.'Objective ID')) = 0,
// Add new record if it doesn't exist
Collect(
colRowMonthData,
AddColumns(
Gallery2_4.Selected,
IsChanged,
1,
UnitType,
If(
IsNumeric(Self.Text) && Text(ThisItem.Unit) <> "text" ,
1,
Text(ThisItem.Unit) = "text",
1,
IsBlank(Self.Text),
1,0
)
)
),
// Use Patch to update the record if it exists
Patch(
colRowMonthData,
LookUp(colRowMonthData, 'Objective ID' = ThisItem.'Objective ID'),
AddColumns(
Gallery2_4.Selected,
IsChanged,
1,
UnitType,
If(
IsNumeric(Self.Text) && Text(ThisItem.Unit) <> "text" ,
1,
Text(ThisItem.Unit) = "text",
1,
IsBlank(Self.Text),
1,0
)
)
)
);
Patch(colObjectivesData,
ThisItem,
{
'Result jan': If(
ThisItem.Unit <> Unit.text,
Value(Self.Text),
Blank()
),
'Result jan t': If(
ThisItem.Unit = Unit.text,
Self.Text,
Blank()
)
}
);
If(
ThisItem.Unit = Unit.text,true, IsNumeric(Self.Text) || IsBlank(Self.Text),true,UpdateContext({varwarningPopup:true})
)
if users enter the data and come out data will disappear and if users removed the data appear again. please give the solution.
Thank you