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 / Strange behaviour of C...
Power Apps
Unanswered

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:
I have the same question (0)
  • Verified answer
    timl Profile Picture
    36,383 Super User 2025 Season 2 on at

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

     

  • Aapok Profile Picture
    on at

    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. 

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…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard