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

IF - Mulitple actions

I am trying to make two actions happen on IF:

 

    If(
        CrdStaffMemberData.Text = User().FullName,
            Set(RecordChanged,"1");
            DisplayMode.Edit,
            DisplayMode.View
    )

 

I understood that ; chained actions together but it is saying I have an invalid IF statement. Any ideas?

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: IF - Mulitple actions

Hi @Anonymous

 

It looks like you're trying to set a card to 'read-only' if the 'Staff Member' of the record doesn't match the currently logged on user.

If you're setting the value of a property (eg DisplayMode) with an If statement, the If statement should only return your desired value and nothing more.

The Set function is a 'Behavior method' - this is a function that changes the state of an app. You can only use 'Behavior methods' in 'Behavior Properties', such as the 'OnSelect' or 'OnVisible' properties of a control. It's not possible to call Set in a non-behavior property such as DisplayMode and I think this is the cause of your problem.

View solution in original post

1 REPLY 1
Super User
Super User

Re: IF - Mulitple actions

Hi @Anonymous

 

It looks like you're trying to set a card to 'read-only' if the 'Staff Member' of the record doesn't match the currently logged on user.

If you're setting the value of a property (eg DisplayMode) with an If statement, the If statement should only return your desired value and nothing more.

The Set function is a 'Behavior method' - this is a function that changes the state of an app. You can only use 'Behavior methods' in 'Behavior Properties', such as the 'OnSelect' or 'OnVisible' properties of a control. It's not possible to call Set in a non-behavior property such as DisplayMode and I think this is the cause of your problem.

View solution in original post

Helpful resources

Announcements
firstImage

Microsoft Business Applications Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Demo Extravaganza Championship Voting Open

Voting Ends: October 30, 2019!

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

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

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

Top Kudoed Authors
Users Online
Currently online: 311 members 4,418 guests
Please welcome our newest community members: