cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
NicolleAbrahams
Frequent Visitor

Complex if statement with multiple conditions

Hi everyone,

 

I need help with a complex if statement. I am creating a guided upload application for users to upload their documents to SharePoint and add specialised metadata.

 

For each different document type there are different metadata requirements. I need the "Submit" button to be disabled if not all the fields have been completed or a document attached.

 

The IF statment logic is escaping me, this is what I have come up with so far but it has not worked;

 

If(Field1="DocumentType1" && IsBlank(Field1A) || IsBlank(Field1B) || IsBlank(Field1C), Disabled, Edit),

If(Field1="DocumentType2" && IsBlank(Field2A) || IsBlank(Field2B), Disabled, Edit),

If(Field1="DocumentType3" && IsBlank(Field3A) || IsBlank(Field3B) || IsBlank(Field3C) || IsBlank(Field3D), Disabled, Edit)

 

Any help will be greatly appreciated!

1 ACCEPTED SOLUTION

Accepted Solutions
Kosenurm
Post Prodigy
Post Prodigy

Try this...

 

If(Field1="DocumentType1" && (IsBlank(Field1A) || IsBlank(Field1B) || IsBlank(Field1C)), Disabled,
   If(Field1="DocumentType2" && (IsBlank(Field2A) || IsBlank(Field2B)), Disabled,
      If(Field1="DocumentType3" && (IsBlank(Field3A) || IsBlank(Field3B) || IsBlank(Field3C) || IsBlank(Field3D)), Disabled, Edit)))

View solution in original post

4 REPLIES 4
Kosenurm
Post Prodigy
Post Prodigy

Try this...

 

If(Field1="DocumentType1" && (IsBlank(Field1A) || IsBlank(Field1B) || IsBlank(Field1C)), Disabled,
   If(Field1="DocumentType2" && (IsBlank(Field2A) || IsBlank(Field2B)), Disabled,
      If(Field1="DocumentType3" && (IsBlank(Field3A) || IsBlank(Field3B) || IsBlank(Field3C) || IsBlank(Field3D)), Disabled, Edit)))

No luck on that, for some reason it will always use the Else value even if the first If statement resolves to true.

NicolleAbrahams
Frequent Visitor

Ok I got it working now the issue was the ambiguity with the ORs so I just made AND scenarions with the True value being DisplayMode.Edit and Else being DisplayMode.Disabled 🙂 

NicolleAbrahams
Frequent Visitor

Ok I got it working now the issue was the ambiguity with the ORs so I just made AND scenarions with the True value being DisplayMode.Edit and Else being DisplayMode.Disabled 🙂 

Helpful resources

Top Solution Authors
Top Kudoed Authors
Users online (4,234)