web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Powerfx syntax for mul...
Power Apps
Suggested Answer

Powerfx syntax for multiple conditions and multiple actions

(0) ShareShare
ReportReport
Posted on by
What is the correct syntax for the following. I've tried using two semicolons between the actions, I've tried wrapping the actions in curly brackets. Please let me know if you have a working version of something like this. I am in Canada. I understand there are some locale differences in syntax for powerfx. 

 
If(
conditionA ||
conditionB ||
conditionC,

Set(varName,
Patch(
'sitename',
Defaults('ListBName'),
{
Title: "Details",
First_x0020_Name: varItem.First_x0020_Name,
Last_x0020_Name: varItem.Last_x0020_Name,
}
)
);
'PowerAutomateFlowName'.Run(
        'FormName'.LastSubmit.ColumnName & " Some Text",
        varItem.ID,
        varName.ID,
        "Another value"
    )
);

...
 
Categories:
I have the same question (0)
  • Suggested answer
    SebS Profile Picture
    4,692 Moderator on at
    it should look like this I added With() So it's more safe to validate the ID exist


    If(
        conditionA || conditionB || conditionC,
        
        With(
            {
                _record:
                    Patch(
                        'sitename',
                        Defaults('ListBName'),
                        {
                            Title: "Details",
                            First_x0020_Name: varItem.First_x0020_Name,
                            Last_x0020_Name: varItem.Last_x0020_Name
                        }
                    )
            },
            Set(varName, _record);
            'PowerAutomateFlowName'.Run(
                'FormName'.LastSubmit.ColumnName & " Some Text",
                varItem.ID,
                _record.ID,
                "Another value"
            )
        )
    )

    Let me know if it works for you hard to check from my end :)
     
     
  • WarrenBelz Profile Picture
    153,698 Most Valuable Professional on at
    Firstly @SebS's structure is more ideal as it eliminates an unnecessary variable (and I have used it below), however I think your issue lies elsewhere. You are patching the site instead of the list
    If(
       conditionA || conditionB || conditionC,
       With(
          {
             _Name,
             Patch(
                'ListBName',
                Defaults('ListBName'),
                {
                   Title: "Details",
                   First_x0020_Name: varItem.First_x0020_Name,
                   Last_x0020_Name: varItem.Last_x0020_Name,
                }
             )
          },
          'PowerAutomateFlowName'.Run(
             'FormName'.LastSubmit.ColumnName & " Some Text",
             varItem.ID,
             _Name.ID,
             "Another value"
          )
       )
    );
     
    Please ✅ Does this answer your question if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider answering Yes to Was this reply helpful? or give it a Like ♥
    Visit my blog
    Practical Power Apps    LinkedIn  

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Apps

#1
Kalathiya Profile Picture

Kalathiya 468

#2
WarrenBelz Profile Picture

WarrenBelz 379 Most Valuable Professional

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 332 Super User 2025 Season 2

Last 30 days Overall leaderboard