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
thirdimage

Power Automate Community User Group Member Badge

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

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors (Last 30 Days)
Users online (4,695)