Hi Guys,
I have the below code on my OnSelect to not allow the user to proceed to the next screen unless certain fields are filled in. Could you tell me how I can also include that If 'Dropdown-Status' is set to the option Closed then 'Txt-ImmediateCorrection'.Text must have some text in the box and the same for 'Txt-PermanentPreventative so both boxes must have something entered into the box if the status dropdown is set to closed otherwise they can't proceed to the next screen? If the Status dropdown is set to Open then those 2 text boxes don't require to have data?
If(
'Dropdown-Classification'.Selected.Value = "Please select an option" ||
'Dropdown-Status'.Selected.Value = "Please select an option" ||
'Dropdown-Hours'.Selected.Value = "Hour" ||
'Dropdown-Minutes'.Selected.Value = "Minutes" ||
'Dropdown-JobSpecific'.Selected.Value = "Please select an option" ||
'Dropdown-BusinessUnit'.Selected.Value = "Please select an option" ||
'Dropdown-SourceFunction'.Selected.Result = "Please select an option" ||
'Dropdown-CauseCategory'.Selected.Title = "Please select an option" ||
'Dropdown-Source'.Selected.Value = "Please select an option" ||
'Dropdown-BusinessChange'.Selected.Value = "Please select an option",
Notify("Please fill out all items, anything highlighted in red requires something entering");
Set(varOnSubmit, true),
Navigate(Costs,Cover);
Set(varOnSubmit, false)
)
Many Thanks
Hi,
you can below to border color property of your 2 TextInput fields -
If(varOnSubmit && 'Dropdown-Status'.Selected.Value = "Closed" && IsBlank(Self.Text), Red, RGBA(0, 18, 107, 1))
Hi @NandiniBhagya20 thanks for this, that has worked. Can you advise what I would need to put as the border colour for the two text fields please so that they are red if they haven't been filled in with any information? I have done the below but clearly done something wrong.
If(varOnSubmit & ('Dropdown-Status'.Selected.Value = "Closed"), Red, RGBA(0, 18, 107, 1))
Thanks Again!
@Dave-ITMan you could just add another logical test
If(
'Dropdown-Classification'.Selected.Value = "Please select an option" ||
'Dropdown-Status'.Selected.Value = "Please select an option" ||
'Dropdown-Hours'.Selected.Value = "Hour" ||
'Dropdown-Minutes'.Selected.Value = "Minutes" ||
'Dropdown-JobSpecific'.Selected.Value = "Please select an option" ||
'Dropdown-BusinessUnit'.Selected.Value = "Please select an option" ||
'Dropdown-SourceFunction'.Selected.Result = "Please select an option" ||
'Dropdown-CauseCategory'.Selected.Title = "Please select an option" ||
'Dropdown-Source'.Selected.Value = "Please select an option" ||
'Dropdown-BusinessChange'.Selected.Value = "Please select an option" ||
And('Dropdown-Status'.Selected.Value = "Open",IsBlank(Txt-ImmediateCorrection.Text),IsBlank(Txt-PermanentPreventative.Text)),
Notify("Please fill out all items, anything highlighted in red requires something entering");
Set(varOnSubmit, true),
Navigate(Costs,Cover);
Set(varOnSubmit, false)
)
Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.
In these cases I use the updateContext. So in the OnSelect you mentioned, I would doe something like this:
UpdateContext({boolMeetedStatusReq: If(Dropdown-Status.Selected.Value = "Closed" && !IsBlank(Txt-PermanentPreventative.Text),false,true)});
If(
boolMeetedStatusReq ||
'Dropdown-Classification'.Selected.Value = "Please select an option" ||
'Dropdown-Status'.Selected.Value = "Please select an option" ||
'Dropdown-Hours'.Selected.Value = "Hour" ||
'Dropdown-Minutes'.Selected.Value = "Minutes" ||
'Dropdown-JobSpecific'.Selected.Value = "Please select an option" ||
'Dropdown-BusinessUnit'.Selected.Value = "Please select an option" ||
'Dropdown-SourceFunction'.Selected.Result = "Please select an option" ||
'Dropdown-CauseCategory'.Selected.Title = "Please select an option" ||
'Dropdown-Source'.Selected.Value = "Please select an option" ||
'Dropdown-BusinessChange'.Selected.Value = "Please select an option",
Notify("Please fill out all items, anything highlighted in red requires something entering");
Set(varOnSubmit, true),
Navigate(Costs,Cover);
Set(varOnSubmit, false)
)
Hi,
Try adding this to your If statement:
Dropdown-Status.SelectedText.Value = "Closed" && IsBlank(Txt-PermanentPreventative)
You can try using below formula
If(
('Dropdown-Classification'.Selected.Value = "Please select an option" ||
'Dropdown-Status'.Selected.Value = "Please select an option" ||
'Dropdown-Hours'.Selected.Value = "Hour" ||
'Dropdown-Minutes'.Selected.Value = "Minutes" ||
'Dropdown-JobSpecific'.Selected.Value = "Please select an option" ||
'Dropdown-BusinessUnit'.Selected.Value = "Please select an option" ||
'Dropdown-SourceFunction'.Selected.Result = "Please select an option" ||
'Dropdown-CauseCategory'.Selected.Title = "Please select an option" ||
'Dropdown-Source'.Selected.Value = "Please select an option" ||
'Dropdown-BusinessChange'.Selected.Value = "Please select an option") || ('Dropdown-status'.Selected.Value="Closed" && (IsBlank(TextInputName.Text)|| IsBlank(TextInputName.Text)))) ,
Notify("Please fill out all items, anything highlighted in red requires something entering");
Set(varOnSubmit, true),
Navigate(Costs,Cover);
Set(varOnSubmit, false)
)
WarrenBelz
146,658
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
65,999
Most Valuable Professional