web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Issue with command wit...
Power Apps
Answered

Issue with command with multiple If statement

(0) ShareShare
ReportReport
Posted on by 146

Hi all
I'm hoping anyone can assist me with this mess :). I trying to create a logic to an SP list using power apps, but I am using several If statements and one if it works perfect, but when I try to add the rest in different ways, I can't; I keep giving myself an error. below is what I wrote that works

 

If(ThisItem.'Purpose of Request'.Value="New Initiative/Program" && ThisItem.'Expected Timeframe'.Value ="Within the next two weeks (urgent)" && ThisItem.'Approval Status'.Value="Approved",DateAdd(ThisItem.Date, -1 * (Weekday(ThisItem.Date, Monday) - 15), Days))

 

below is the rest, with the added statements.

 

If(ThisItem.'Purpose of Request'.Value="New Initiative/Program" && ThisItem.'Expected Timeframe'.Value ="Within the next two weeks (urgent)" && ThisItem.'Approval Status'.Value="Approved",DateAdd(ThisItem.Date, -1 * (Weekday(ThisItem.Date, Monday) - 15), Days)), If(ThisItem.'Purpose of Request'.Value="New Initiative/Program" && ThisItem.'Expected Timeframe'.Value = "Four to six weeks from today"&& ThisItem.'Approval Status'.Value="Approved",DateAdd(ThisItem.Date, -1 * (Weekday(ThisItem.Date, Monday) - 29), Days)), If(ThisItem.'Purpose of Request'.Value="New Initiative/Program" && ThisItem.'Expected Timeframe'.Value = "Four to six weeks from today"&& ThisItem.'Approval Status'.Value="Approved",DateAdd(ThisItem.Date, -1 * (Weekday(ThisItem.Date, Monday) -50 ), Days)), If(ThisItem.'Purpose of Request'.Value="Add an item onto the Collection Operations Governance Calendar ONLY" && ThisItem.'Expected Timeframe'.Value ="Within the next two weeks (urgent)" && ThisItem.'Approval Status'.Value="Approved",DateAdd(ThisItem.Date, -1 * (Weekday(ThisItem.Date, Monday) - 15), Days)), If(ThisItem.'Purpose of Request'.Value="Add an item onto the Collection Operations Governance Calendar ONLY" && ThisItem.'Expected Timeframe'.Value = "Four to six weeks from today"&& ThisItem.'Approval Status'.Value="Approved",DateAdd(ThisItem.Date, -1 * (Weekday(ThisItem.Date, Monday) - 29), Days)), If(ThisItem.'Purpose of Request'.Value="Add an item onto the Collection Operations Governance Calendar ONLY" && ThisItem.'Expected Timeframe'.Value = "Four to six weeks from today "&& ThisItem.'Approval Status'.Value="Approved",DateAdd(ThisItem.Date, -1 * (Weekday(ThisItem.Date, Monday) -50 ), Days))

Categories:
I have the same question (0)
  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    @ReyOrtiz 

    Please review your conditions and if I am right, please correct it.  It appears he text in green are identical and the text in pink are identical but the results are different(Underlined and italic). 

    If(ThisItem.'Purpose of Request'.Value="New Initiative/Program" && ThisItem.'Expected Timeframe'.Value ="Within the next two weeks (urgent)" && ThisItem.'Approval Status'.Value="Approved",DateAdd(ThisItem.Date, -1 * (Weekday(ThisItem.Date, Monday) - 15), Days)),

    If(ThisItem.'Purpose of Request'.Value="New Initiative/Program" && ThisItem.'Expected Timeframe'.Value = "Four to six weeks from today"&& ThisItem.'Approval Status'.Value="Approved",DateAdd(ThisItem.Date, -1 * (Weekday(ThisItem.Date, Monday) - 29), Days)),

    If(ThisItem.'Purpose of Request'.Value="New Initiative/Program" && ThisItem.'Expected Timeframe'.Value = "Four to six weeks from today"&& ThisItem.'Approval Status'.Value="Approved",DateAdd(ThisItem.Date, -1 * (Weekday(ThisItem.Date, Monday) -50 ), Days)),

    If(ThisItem.'Purpose of Request'.Value="Add an item onto the Collection Operations Governance Calendar ONLY" && ThisItem.'Expected Timeframe'.Value ="Within the next two weeks (urgent)" && ThisItem.'Approval Status'.Value="Approved",DateAdd(ThisItem.Date, -1 * (Weekday(ThisItem.Date, Monday) - 15), Days)),

    If(ThisItem.'Purpose of Request'.Value="Add an item onto the Collection Operations Governance Calendar ONLY" && ThisItem.'Expected Timeframe'.Value = "Four to six weeks from today"&& ThisItem.'Approval Status'.Value="Approved",DateAdd(ThisItem.Date, -1 * (Weekday(ThisItem.Date, Monday) - 29), Days)), If(ThisItem.'Purpose of Request'.Value="Add an item onto the Collection Operations Governance Calendar ONLY" && ThisItem.'Expected Timeframe'.Value = "Four to six weeks from today "&& ThisItem.'Approval Status'.Value="Approved",DateAdd(ThisItem.Date, -1 * (Weekday(ThisItem.Date, Monday) -50 ), Days))

  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    @ReyOrtiz 

    Please review your conditions and if I am right, please correct it.  It appears he text in green is identical and the text in pink is identical but the results are different(Underlined and italic). 

    If(ThisItem.'Purpose of Request'.Value="New Initiative/Program" && ThisItem.'Expected Timeframe'.Value ="Within the next two weeks (urgent)" && ThisItem.'Approval Status'.Value="Approved",DateAdd(ThisItem.Date, -1 * (Weekday(ThisItem.Date, Monday) - 15), Days)),

    If(ThisItem.'Purpose of Request'.Value="New Initiative/Program" && ThisItem.'Expected Timeframe'.Value = "Four to six weeks from today"&& ThisItem.'Approval Status'.Value="Approved",DateAdd(ThisItem.Date, -1 * (Weekday(ThisItem.Date, Monday) - 29), Days)),

    If(ThisItem.'Purpose of Request'.Value="New Initiative/Program" && ThisItem.'Expected Timeframe'.Value = "Four to six weeks from today"&& ThisItem.'Approval Status'.Value="Approved",DateAdd(ThisItem.Date, -1 * (Weekday(ThisItem.Date, Monday) -50 ), Days)),

    If(ThisItem.'Purpose of Request'.Value="Add an item onto the Collection Operations Governance Calendar ONLY" && ThisItem.'Expected Timeframe'.Value ="Within the next two weeks (urgent)" && ThisItem.'Approval Status'.Value="Approved",DateAdd(ThisItem.Date, -1 * (Weekday(ThisItem.Date, Monday) - 15), Days)),

    If(ThisItem.'Purpose of Request'.Value="Add an item onto the Collection Operations Governance Calendar ONLY" && ThisItem.'Expected Timeframe'.Value = "Four to six weeks from today"&& ThisItem.'Approval Status'.Value="Approved",DateAdd(ThisItem.Date, -1 * (Weekday(ThisItem.Date, Monday) - 29), Days)), If(ThisItem.'Purpose of Request'.Value="Add an item onto the Collection Operations Governance Calendar ONLY" && ThisItem.'Expected Timeframe'.Value = "Four to six weeks from today "&& ThisItem.'Approval Status'.Value="Approved",DateAdd(ThisItem.Date, -1 * (Weekday(ThisItem.Date, Monday) -50 ), Days))

  • Verified answer
    Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    @ReyOrtiz 

    Cleaning it up a bit:

     

    With({**bleep**:"New Initiative/Program" 
     gov:"Add an item onto the Collection Operations Governance Calendar ONLY"
     val:ThisItem.'Purpose of Request'.Value
     ap:ThisItem.'Approval Status'.Value="Approved",
     tf:ThisItem.'Expected Timeframe'.Value,
     da:DateAdd(ThisItem.Date,-1,
     wk:(Weekday(ThisItem.Date, Monday)
     },
     If( 
     val=**bleep**&&ap&&tf="Within the next two weeks (urgent)", da*wk-15),
     val=**bleep**&&ap&&tf="Four to six weeks from today", da*wk-29), //*one is wrong
     val=**bleep**&&ap&&tf="Four to six weeks from today", da*wk-50), //*one is wrong
     val=gov&&ap&&tf="Within the next two weeks (urgent)",da*wk-15),
     val=gov&&ap&&tf="Four to six weeks from today", da*wk-29), //*one is wrong
     val=gov&&ap&&tf="Four to six weeks from today ", da*wk- 50) //* one is wrong

    I have no idea why the editor replaced "ni" on my formula with **bleep**

     

  • ReyOrtiz Profile Picture
    146 on at

    @Drrickryp
    You were right; the one with -50 was supposed to be Seven weeks or more, but I used your cleanup version, and the only thing I did was a switch - to +, which is working fine. Thank you for the help and for showing me this way to do formulas.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 358 Most Valuable Professional

#2
11manish Profile Picture

11manish 207 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 150 Super User 2026 Season 2

Last 30 days Overall leaderboard