SOLVED

PowerApps - IF OR With a Date

%3CLINGO-SUB%20id%3D%22lingo-sub-401004%22%20slang%3D%22en-US%22%3EPowerApps%20-%20IF%20OR%20With%20a%20Date%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-401004%22%20slang%3D%22en-US%22%3E%3CP%3EI%20have%20an%20IF%20OR%20that%20keeps%20a%20Submit%20button%20set%20to%20%22DisplayMode%3A%20Disabled%22%20until%20all%20fields%20satisfy%20the%20conditions%20when%20checking%20if%20text%20controls%20are%20blank%20or%20not%20numeric.%20It%20will%20then%20make%20the%26nbsp%3B%22DisplayMode%3A%20Edit%22%20so%20the%20form%20can%20be%20submitted.%20This%20is%20working.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIf(Or(%20IsBlank(txtClientNameSignature)%2C%20IsBlank(txtProposalNameSignature)%2C%20IsBlank(txtSignatureNameRequired)%2C%20!IsNumeric(txtNumDocsToSign.Text)%2C%20IsBlank(txtDocumentNames)%20)%2C%20DisplayMode.Disabled%2C%20DisplayMode.Edit)%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHowever%2C%20when%20I%20add%20a%20check%20for%26nbsp%3B%3CSTRONG%3EdpkrDueDateSignature.SelectedDate%20%26lt%3B%20Today()%2B15%3C%2FSTRONG%3E%20it%20will%20still%20allow%20button%20to%20be%20in%20Edit%20mode%20even%20if%20date%20condition%20is%20not%20met.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIf(Or(%20IsBlank(txtClientNameSignature)%2C%20IsBlank(txtProposalNameSignature)%2C%20IsBlank(txtSignatureNameRequired)%2C%20!IsNumeric(txtNumDocsToSign.Text)%2C%20IsBlank(txtDocumentNames)%2C%20%3CSTRONG%3EdpkrDueDateSignature.SelectedDate%20%26lt%3B%20Today()%2B15%3C%2FSTRONG%3E%20)%2C%20DisplayMode.Disabled%2C%20DisplayMode.Edit)%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAny%20recommendations%20are%20appreciated.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-401004%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EPowerApps%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Highlighted
Contributor

I have an IF OR that keeps a Submit button set to "DisplayMode: Disabled" until all fields satisfy the conditions when checking if text controls are blank or not numeric. It will then make the "DisplayMode: Edit" so the form can be submitted. This is working.

 

If(Or( IsBlank(txtClientNameSignature), IsBlank(txtProposalNameSignature), IsBlank(txtSignatureNameRequired), !IsNumeric(txtNumDocsToSign.Text), IsBlank(txtDocumentNames) ), DisplayMode.Disabled, DisplayMode.Edit) 

 

However, when I add a check for dpkrDueDateSignature.SelectedDate < Today()+15 it will still allow button to be in Edit mode even if date condition is not met. 

 

If(Or( IsBlank(txtClientNameSignature), IsBlank(txtProposalNameSignature), IsBlank(txtSignatureNameRequired), !IsNumeric(txtNumDocsToSign.Text), IsBlank(txtDocumentNames), dpkrDueDateSignature.SelectedDate < Today()+15 ), DisplayMode.Disabled, DisplayMode.Edit)

 

Any recommendations are appreciated.

 

2 Replies
Highlighted

Anyone know how to resolve this issue? Recommendations appreciated.

Highlighted
Best Response confirmed by cgtrman (Contributor)
Solution

Resolved. Solution in bold.

 

If(Or( IsBlank(txtClientNameSignature), IsBlank(txtProposalNameSignature), IsBlank(txtSignatureNameRequired), !IsNumeric(txtNumDocsToSign.Text), IsBlank(txtDocumentNames), dpkrDueDateSignature.SelectedDate < DateAdd( Today(), 15, Days) ), DisplayMode.Disabled, DisplayMode.Edit)