cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Wapfunz
Level: Powered On

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
Super User
Super User

Re: If Statement - Peninput true then send email.

@Wapfunzthere 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
Super User
Super User

Re: If Statement - Peninput true then send email.

@Wapfunzthere 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

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
Wapfunz
Level: Powered On

Re: If Statement - Peninput true then send email.

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

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

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors
Users Online
Currently online: 195 members 6,152 guests
Please welcome our newest community members: