cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Questionasking
Helper III
Helper III

A Multiple If Statment, (with attachments) and may fields and variables. i just cant get my head around the formula.

Id like for an icon to only be visible if the following fields are NOT blank


If(IsBlank(dcvasset.SelectedText) || IsBlank(Value(dcvkms.Text))|| IsBlank(dcvbrakes.Selected)|| IsBlank(dcvsteer.Selected)|| IsBlank(dcvseat.Selected)|| IsBlank(dcvtyres.Selected)|| IsBlank(dcvunder.Selected)|| IsBlank(dcvlights.Selected)|| IsBlank(dcvsafety.Selected)|| IsBlank(dcvtwo.Selected)|| IsBlank(dcvservice.Selected)|| IsBlank(dcvbody.Selected)|| IsBlank(dcvinstru.Selected)|| IsBlank(dcvcargo.Selected)|| IsBlank(dcvaccess.Selected)|| IsBlank(dcvpre.Selected)|| IsBlank(dcvinspected.Text) || IsBlank(dcvpre.Selected)|| IsBlank(dcvreg.Text)|| IsBlank(dcvdate.SelectedDate) YEP the bit below goes here 🙂 ,false,true)

and if the following conditions are true,
|| varRedWarning = true|| varYellowWarning = true || varWhiteWarning = true 

the bit im stuck on is if one of the variables below are true (or false, i can work that bit out) they have to have an attachment that relates to them.

 

Ie. the user fills out a form and the first part of the code checks to see if all the required fields are not blank, the second bit of the code checks to see if the variables are true and the third and final piece i cant figure out checks to see if the variables are true but if they also have a attachment thats related to them. How do we write if statments like this with an attachment?

 

Any help writing this code would be very helpful.

1 ACCEPTED SOLUTION

Accepted Solutions
mdevaney
Super User
Super User

@Questionasking 

I'm not clear on your instructions.  You said if one of the variables is true or false... well it can't both!  It's one or the other...

 

"the bit im stuck on is if one of the variables below are true (or false, i can work that bit out) they have to have an attachment that relates to them"

 

So let's assume a different attachment is required for each variable when its true.  Rewrite this section...

varRedWarning = true|| varYellowWarning = true || varWhiteWarning = true 

 

As this code...

(varRedWarning = true And !IsBlank(AttachmentRed.Attachments)) Or varRedWarning = false)
And (varYellowWarning = true And !IsBlank(AttachmentYellow.Attachments)) Or varYellowWarning = false)
And (varWhiteWarning = true And !IsBlank(AttachmentWhite.Attachments)) Or varWhiteWarning = false)

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

View solution in original post

3 REPLIES 3
mdevaney
Super User
Super User

@Questionasking 

I'm not clear on your instructions.  You said if one of the variables is true or false... well it can't both!  It's one or the other...

 

"the bit im stuck on is if one of the variables below are true (or false, i can work that bit out) they have to have an attachment that relates to them"

 

So let's assume a different attachment is required for each variable when its true.  Rewrite this section...

varRedWarning = true|| varYellowWarning = true || varWhiteWarning = true 

 

As this code...

(varRedWarning = true And !IsBlank(AttachmentRed.Attachments)) Or varRedWarning = false)
And (varYellowWarning = true And !IsBlank(AttachmentYellow.Attachments)) Or varYellowWarning = false)
And (varWhiteWarning = true And !IsBlank(AttachmentWhite.Attachments)) Or varWhiteWarning = false)

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

WarrenBelz
Super User
Super User

Hi @Questionasking ,

Put this on the Visible of the item

(
   IsBlank(dcvasset.SelectedText) || 
   IsBlank(Value(dcvkms.Text))|| 
   IsBlank(dcvbrakes.Selected)|| 
   IsBlank(dcvsteer.Selected)|| 
   IsBlank(dcvseat.Selected)|| 
   IsBlank(dcvtyres.Selected)|| 
   IsBlank(dcvunder.Selected)|| 
   IsBlank(dcvlights.Selected)|| 
   IsBlank(dcvsafety.Selected)|| 
   IsBlank(dcvtwo.Selected)|| 
   IsBlank(dcvservice.Selected)|| 
   IsBlank(dcvbody.Selected)|| 
   IsBlank(dcvinstru.Selected)|| 
   IsBlank(dcvcargo.Selected)|| 
   IsBlank(dcvaccess.Selected)|| 
   IsBlank(dcvpre.Selected)|| 
   IsBlank(dcvinspected.Text) || 
   IsBlank(dcvpre.Selected)|| 
   IsBlank(dcvreg.Text)|| 
   Value(dcvdate.SelectedDate)=0
) && 
(
   varRedWarning || varYellowWarning || varWhiteWarning
)   

 

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.


@mdevaney wrote:

@Questionasking 

I'm not clear on your instructions.  You said if one of the variables is true or false... well it can't both!  It's one or the other...

 

 

"the bit im stuck on is if one of the variables below are true (or false, i can work that bit out) they have to have an attachment that relates to them"

 

 

So let's assume a different attachment is required for each variable when its true.  Rewrite this section...

 

varRedWarning = true|| varYellowWarning = true || varWhiteWarning = true 

 

 

As this code...

 

(varRedWarning = true And !IsBlank(AttachmentRed.Attachments)) Or varRedWarning = false)
And (varYellowWarning = true And !IsBlank(AttachmentYellow.Attachments)) Or varYellowWarning = false)
And (varWhiteWarning = true And !IsBlank(AttachmentWhite.Attachments)) Or varWhiteWarning = false)

 

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."


Yes sorry, as i re-read my post i really didnt explain myself clearly, i guess i was trying to say the attachments are . However you did answer my question in a roundabout way.  

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

365 EduCon 768x460.png

Microsoft 365 EduCon

Join us for two optional days of workshops and a 3-day conference, you can choose from over 130 sessions in multiple tracks and 25 workshops.

Users online (4,137)