Dear all:
I am a starter for power apps with sharepoint.
Now i have one question about how to use IF function.
The situation is that i have a condition, if the condition "ApproverEmail" is Blank(), then send email to user().Email for "TEST1", if the condition "ApproverEmail is not Blank(), then send email to User().Email for "TEST2"
IF ApproverEmail = Blank() Then send email to User().Email for "TEST1"
IF ApproverEmail <> Blank() Then send email to User().Email for "TEST2"
But i don't know how to write IF function by Power apps for above case.
Would you please help me ?
Thanks a lot!
Solved! Go to Solution.
If(
//Condition 1
ApproverEmail = Blank()
,
//Result 1
"Then send email to User().Email for TEST1 "
,
//Condition 2
ApproverEmail <> Blank()
,
//Result 2
"Then send email to User().Email for TEST2 "
)
Change the text part to the actual function for sending emails as you have in your app, but this is the correct If function formatting
@iAm_ManCat |
Please 'Mark as Solution' if someone's post answered your question and always 'Thumbs Up' the posts you like or that helped you! |
Thanks! |
If(
//Condition 1
ApproverEmail = Blank()
,
//Result 1
"Then send email to User().Email for TEST1 "
,
//Condition 2
ApproverEmail <> Blank()
,
//Result 2
"Then send email to User().Email for TEST2 "
)
Change the text part to the actual function for sending emails as you have in your app, but this is the correct If function formatting
@iAm_ManCat |
Please 'Mark as Solution' if someone's post answered your question and always 'Thumbs Up' the posts you like or that helped you! |
Thanks! |
Yes, it is working now.
Sorry for later reply.
By the way, it is possible i run two steps for one condition?
For example:
If(
ApproverEmail = Blank()
,
Send Email to user & Patch( list1, { ApprovalStatus : "Approved" })
)
Thanks for your support:)
Yes of course 🙂
You can separate additional code within the same step with a semi-colon like this:
If(
//Condition 1
ApproverEmail = Blank()
,
//Result 1
"Then send email to User().Email for TEST1 " ;
Patch(DataSource, Lookup(datasource, ID = ThisItem.ID), {ApprovalStatus: "Approved"}) ;
Navigate('Home Screen')
,
//Condition 2
ApproverEmail <> Blank()
,
//Result 2
"Then send email to User().Email for TEST2 "
)
You can add as many extra steps as you want, and you can also add additional If statement checks by putting another comma in and having a third condition that gives a third result etc etc
@iAm_ManCat |
Please 'Mark as Solution' if someone's post answered your question and always 'Thumbs Up' the posts you like or that helped you! |
Thanks! |
User | Count |
---|---|
246 | |
105 | |
82 | |
50 | |
43 |