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 / Complex If statement
Power Apps
Answered

Complex If statement

(0) ShareShare
ReportReport
Posted on by 7

Hello

 

I am trying to make a single If statement that is rather complex with many layers, any help would be appreciated.

 

I have a singular form that is a 3 step process with each step having its own access level (variable is formUser).
Step1: creation/created = CB

Step2: management = LM

Step3: actioning = AO
There is also New and View Only (VO) access levels.

 

If(!IsBlank(selectedticket.ID), //No ID means this is not a pre-existing ticket so set formUser to "New"
If(User().FullName = selectedticket.'Actioning Officer'.DisplayName, //is this user the actioning officer?
If(User().FullName = selectedticket.'Line Manager'.DisplayName, //is this user the line manager?
If(User().FullName = selectedticket.'Created By'.DisplayName, //is this user the creator?
If(
User().FullName <> selectedticket.'Created By'.DisplayName
&& User().FullName <> selectedticket.'Line Manager'.DisplayName
&& User().FullName <> selectedticket.'Actioning Officer'.DisplayName
,
Set(formUser, "VO")), //set to view only (VO) if this user is not actioning officer, line manager or creator
Set(formUser, "CB")), //set to creation/created (CB) if you are the creator
Set(formUser, "LM")), //set to management (LM) if you are the line manager
Set(formUser, "AO")), //set to actioning (AO) if you are the actioning officer
Set(formUser, "New")); //if the ticket ID is blank this not a pre-existing ticket so set the ticket to "New"

Thanks in advanced

Categories:
  • Verified answer
    CU-18081211-6 Profile Picture
    9,272 Moderator on at

    Hi @e9d ,

    Is your formula working ?

    Here is my proposal ...

     

    If(!IsBlank(selectedticket.ID),
     Set(formUser,
     Switch(
     User().FullName,
     selectedticket.'ActioningOfficer'.DisplayName,
     "AO",
     selectedticket.'LineManager'.DisplayName,
     "LM",
     selectedticket.'Created By'.DiplayName,
     "CB",
     "VO")
     ),
     Set(formUser,"New")
    )
    

     

    Hope it helps !

  • e9d Profile Picture
    7 on at

    You're a life saver! Thank you so much

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

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 339 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 289

#3
Mohsin Ali Profile Picture

Mohsin Ali 228

Last 30 days Overall leaderboard