cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Anonymous
Not applicable

If Statement - Peninput true then send email.

Hello,

 

I have:

If(PenInput_RepSignature.Image=true,Office365.SendEmail("bill.pollock@gea.com","Signature representative","Body Text",{Attachments:Table({Name:"peninput.jpg",ContentBytes:PenInput_RepSignature.Image,'@odata.type':""})}),)

 

This gives an inconpatible type:

Left value is an image - right value is Boleen.type

 

Is there a simple way to check if the peninput is true and then email if not then dont.

What should I use in the formula to do so - is usding an "If" acceptable?

Ta

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Super User
Super User

Re: If Statement - Peninput true then send email.

@Anonymousthere is not anything that can give you that logic.  You are definitely trying to compare different types in your If statement - in this case a string and a boolean.

 

So, here is an option.  You can set a variable onVisible to get the current image.  Here is an example:

   Set(startImg, Value(Last(Split(PenInput1.Image, "/")).Result))

 

Your If Statement would then be something like this:

   If(!(Value(Last(Split(PenInput1.Image, "/")).Result) = startImg),

        Office365.SendEmail("bill.pollock@gea.com","Signature representative","Body Text",{Attachments:Table ({Name:"peninput.jpg",ContentBytes,PenInput_RepSignature.Image,'@odata.type':""})}),)

 

Note that I was aiming to get the last increment of the image number (assign the Image property to a label text and you will see what I mean).  Probably could have just done an apples to apples comparison (get the image in a variable and compare to current).

 

This does present a problem if the user clears the input as there is no way to intercept that.  However, you could be crafty and put a similar looking icon/image right over that "clear screen" control and in it put the logic to Reset(PenInputControl) and then Set your variable to the new image.

 

Hope this provides a workaround.

 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.

View solution in original post

3 REPLIES 3
Highlighted
Super User
Super User

Re: If Statement - Peninput true then send email.

@Anonymousthere is not anything that can give you that logic.  You are definitely trying to compare different types in your If statement - in this case a string and a boolean.

 

So, here is an option.  You can set a variable onVisible to get the current image.  Here is an example:

   Set(startImg, Value(Last(Split(PenInput1.Image, "/")).Result))

 

Your If Statement would then be something like this:

   If(!(Value(Last(Split(PenInput1.Image, "/")).Result) = startImg),

        Office365.SendEmail("bill.pollock@gea.com","Signature representative","Body Text",{Attachments:Table ({Name:"peninput.jpg",ContentBytes,PenInput_RepSignature.Image,'@odata.type':""})}),)

 

Note that I was aiming to get the last increment of the image number (assign the Image property to a label text and you will see what I mean).  Probably could have just done an apples to apples comparison (get the image in a variable and compare to current).

 

This does present a problem if the user clears the input as there is no way to intercept that.  However, you could be crafty and put a similar looking icon/image right over that "clear screen" control and in it put the logic to Reset(PenInputControl) and then Set your variable to the new image.

 

Hope this provides a workaround.

 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.

View solution in original post

Highlighted
Super User
Super User

Re: If Statement - Peninput true then send email.

Actually...couldn't resist - had to try it out.  Works perfectly.

See image.  Using that logic from the last post and putting X icons over the existing X control icon in the pen input control, I was able to pull it off.

In first control, it is empty and the same as on visible (has pen marking = false)

In second control...well, has pen marking and result is true

In third, user has clicked the X to clear the control - pen marking = false

Of course this doesn't work if the user draws and then erases by hand. But it gets you closer.

wapfunz1.png

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Highlighted
Anonymous
Not applicable

Re: If Statement - Peninput true then send email.

Yahooooooooooooooooooooooooooooooooooooooooooooooooooooooooo!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Fantastic - works well - I am Happy, oh so happy.

Helpful resources

Announcements
secondImage

Demo-Extravaganza 2020

Check out these cool Power Apps & vote on your favorite!

secondImage

Community Highlights

Check out whats happening in Power Apps

secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (9,253)