i am trying to use some IF statements and nested options
i want to query 2 variables, and if blank, show message and stop processing
the form continues on even when blank variables
what am i missing here?
Set(
gblShowLoadingSpinner,
true
);
// Concat the team members to store in SQL
//Set(varConcatenateTeam, Concat(TeamComboBox.SelectedItems, DisplayName & ", "));
Set(
varConcatenateTeam,
Concat(
TeamComboBox.SelectedItems,
DisplayName & If(
CountRows(TeamComboBox.SelectedItems) > 1,
", ",
""
)
)
);
// to not have a , if multiple aren't selected
// Check for table size being selected
If(
IsBlank(varTableSize) || IsBlank(gblRashMapTableSize),// query the tablesize variable, set by clicking the button ; or if an item has been selected and it has a table value set already
UpdateContext({ShowMessage: true});
// Save or update record in SQL
Notify("Please ensure all fields are filled before saving.", NotificationType.Warning, 1000);
Exit(),
// No further actions will be taken after this point
If(
Patch(
'VDC.LogBook',
Defaults('VDC.LogBook'),
{
Shift: ddlShift.Selected.Value,
Date: DatePickerCanvas1.SelectedDate,
Crew: ddlCrew.Selected.Value,
Team: varConcatenateTeam,
Caster: CasterComboBox.Selected.DisplayName,
CastNo: CastNo.Value,
PETCode: PETCode.Value,
Grade: Value(Grade.Value),
'BilletsLost<1m': Value('Billets<1'.Value),
'BilletsLost>1m': Value('Billets>1'.Value),
CastChecks1: CastChecks1Combo.Selected.DisplayName,
CastChecks2: CastChecks2Combo.Selected.DisplayName,
CastChecks3: CastChecks3Combo.Selected.DisplayName,
Comments: Comments.Value,
Status: "In Progress",
SubmittedDateTime: Now(),
Submitter: User().FullName
}
),
Patch(
'VDC.LogBook',
LookUp(
'VDC.LogBook',
),//perform update method in SQL for the ID selected
{
Shift: ddlShift.Selected.Value,
Date: DatePickerCanvas1.SelectedDate,
Crew: ddlCrew.Selected.Value,
Team: If(
IsBlank(varConcatenateTeam),
),
Caster: If(
IsBlank(CasterComboBox.Selected.DisplayName),
gblOpenItems.Caster
),
CastNo: CastNo.Value,
PETCode: PETCode.Value,
Grade: Value(Grade.Value),
'BilletsLost<1m': Value('Billets<1'.Value),
'BilletsLost>1m': Value('Billets>1'.Value),
CastChecks1: If(
IsBlank(CastChecks1Combo.Selected.DisplayName),
gblOpenItems.CastChecks1,
CastChecks1Combo.Selected.DisplayName
),
CastChecks2: If(
IsBlank(CastChecks2Combo.Selected.DisplayName),
gblOpenItems.CastChecks2,
CastChecks2Combo.Selected.DisplayName
),
CastChecks3: If(
IsBlank(CastChecks3Combo.Selected.DisplayName),
gblOpenItems.CastChecks3,
CastChecks3Combo.Selected.DisplayName
),
Comments: Comments.Value,
Status: "In Progress",
ModifiedDateTime: Now()
}
)
)
);
Notify(
"Items have been saved to SQL, continue on with process",
NotificationType.Success,
1000
)
;
// Navigate to the edit screen after operation
Navigate(
VDCEditScreen,
ScreenTransition.UnCoverRight
);
// Reset varTableSize after operation
Set(
varTableSize,Blank()
);
Set(
gblShowLoadingSpinner,
false
);