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

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

 

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.

1 REPLY 1
Super User
Super User

Re: IF - Mulitple actions

Hi @rgriffiths

 

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.

Helpful resources

Announcements
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

SecondImage

Power Platform Summit North America

Register by September 5 to save $200

Users Online
Currently online: 188 members 4,367 guests
Please welcome our newest community members: