cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
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
Highlighted
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
Highlighted
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
secondImage

New Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

Check this Out

Helpful information

Featuring samples like Return to the Workplace and Emergency Response Applications

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (4,597)