Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Building Power Apps
Answered

Strange behaviour of Concurrent function and If statement

(0) ShareShare
ReportReport
Posted on by

I'm experiencing some strange behaviour with the Concurrent function, and while I have found a way to circumvent the issue, I'm hoping someone could explain what is causing this issue.

 

I have a OnTimerEnd function, which first checks if a Sharepoint List item has been updated since the last time the timer finished. If the list has been updated, we refresh a gallery, and if not, we save user input to the list. My logic seems to work just fine, but while attempting to do this to three different items (in different lists) inside a concurrent function, I'm getting the following error "The function 'If' has some invalid arguments.'.

 

Below are some pseudocode examples:

 

 

 

If(
 !listItemUpdated, 
 //true
 Patch(someList, LookUp(someList, ID = someID), {col1: someValue, col2: someValue2,...},
 //false
 Refresh(someList)
)

 

 

 

Above code works as expected, indicating my logic and the Patch function work as they should.

 

 

Concurrent(
If(
 !listItemUpdated, 
 //true
 Patch(someList, LookUp(someList, ID = someID), {col1: someValue, col2: someValue2,...},
 //false
 Refresh(someList)
),
If(
 !list2ItemUpdated,
 Patch(someList2, LookUp(...

)

 

 

Copy pasting the working code inside the Concurrent function gives the error mentioned above.

 

 

Concurrent(
If(
 !listItemUpdated, 
 //true
 Patch(someList, LookUp(someList, ID = someID), {col1: someValue, col2: someValue2,...},
 //false
 Refresh(someList)
); Set(someVar, Blank()),
If(
 !list2ItemUpdated,
 Patch(someList2, LookUp(...

)

 

Now, if I add some other function inside the concurrent formula, the error disappears. I've tried using Set and Notify, and both seem to get rid of the error, so I'm assuming adding any functionality to the formula would get rid of the error.

 

I'm hoping someone could help me identify the cause of the error. If my pseudocode is too vague I can clarify it more in the comments.

 

Thanks in advance.

 

P.S. Hopefully the format of my post is good, it's my first time posting on these forums.

Categories:
  • Aapok Profile Picture
    on at
    Re: Strange behaviour of Concurrent function and If statement

    Thank you for taking the time to reply. I figured it must have been some sort of a parser issue.

    While I still don't understand why adding some other functionality outside the If statement fixes the parser issue, I'm going to accept your post as the solution for clarifying the underlying parser issue. 

  • Verified answer
    timl Profile Picture
    34,939 Super User 2025 Season 1 on at
    Re: Strange behaviour of Concurrent function and If statement

    @Aapok

    The likely cause of this problem is that because the call to 'if' is nested inside 'concurrent', Power Apps cannot parse the expression correctly.

    It'll stem from the fact that it cannot evaluate a consistant return value from the call to 'if'.

    Here, the true path of the 'if' statement returns a record (because that's what Patch returns), whereas the false path returns a boolean (the result of the Refresh operation).

     

    If(
     !listItemUpdated, 
     //true
     Patch(someList, LookUp(someList, ID = someID), {col1: someValue, col2: someValue2,...},
     //false
     Refresh(someList)
    )

     

    If you were to adapt your 'if' syntax so that both paths return a boolean, that should hopefully resolve the error.

    If(
     !listItemUpdated, 
     //true
     Patch(someList, LookUp(someList, ID = someID), {col1: someValue, col2: someValue2,...};
     true,
     //false
     Refresh(someList)
    ) 

     

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,651 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,999 Most Valuable Professional

Leaderboard