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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Concurrent invalid arg...
Power Apps
Answered

Concurrent invalid arguments error

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hello,

 

I'm getting some difficulties trying to do a dynamic function in my PowerApp that enables our employees to update their Office 365 account photo through this Onboarding solution.

It worked before I didn't change my function but it shows me this error:

"The function 'Concurrent' has some invalid arguments.

I have and print attache to this post that show the error.

 

I have in this screen 3 buttons:

1- 'Carregar' that means 'Upload? and its an upload media button to give user the liberty to choose their own photo.

2- 'Cancelar' that menas 'Cancel' that is an button that aloows you to cancel the photo that you have choosen to this I used this function:

 

 

If(Office365Users.UserPhotoMetadata(Office365Users.MyProfile().Id).HasPhoto = true,Office365Users.UserPhoto(Office365Users.MyProfile().Id),people)

 

 

3 - 'Gravar' that means 'Save' button to give the user the abbility to solve the photo that is have choosen to is Office 365 account but ITS DOESNT WORK NOW. My function looks like this:

 

 

//send photo to office365 profile, complete photo task in outlook tasks, patch the local copy with completed task, update local copy of user profile to reflect new photo
Concurrent(Office365Users.UpdateMyPhoto("image/jpeg", UploadedImage1.Image),
 ClearCollect(TempProfileColl, _myProfile), Back()
);
Patch(TempProfileColl, First(TempProfileColl), {userPhoto: UploadedImage1.Image});
Concurrent(
 Set(_myProfile, First(TempProfileColl)),
 Reset(AddMediaButton1)
);
Clear(TempProfileColl)

 

 

 Can somebody help me with this? I would really appreciate!

 

Thank you.

 

Concurrent error - invalid arguments 

Error.PNG
Categories:
I have the same question (0)
  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @Anonymous 

    My first question would be - why are you even using the concurrent function in this way?  There really is no need for it based on what you are doing in them.  Usually Concurrent is used when you are fetching or updating multiple datasources that may consume a long period of time.  Doing them concurrently helps to minimize the amount of time it takes.

    In your case you are doing one datasource (Office 365 in this case) operation and then collecting a value.  In another case you are setting a Global variable and then resetting a control.  None of those need a Concurrent statement and, in fact, trying to use the Back or reset function in a concurrent...I'd don't think that's even something you can do Concurrent (never tried because it never fit the purpose of Concurrent).

     

    Quite honestly, I would simply remove it all and have this as your formula:

    //send photo to office365 profile, complete photo task in outlook tasks, patch the local copy with completed task, update local copy of user profile to reflect new photo
    
    Office365Users.UpdateMyPhoto("image/jpeg", 
     UploadedImage1.Image)
    
    Set(_myProfile, Patch(_myProfile, {userPhoto: UploadedImage1.Image});
    
    Reset(AddMediaButton1);
    Clear(TempProfileColl)

     

    I hope this is helpful for you.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hello,

     

    You're right but i didn't develop this app. I'm responsibile of doing an upgrade so I didn't change this dynamic but I dont know why before it worked and now it didnt.

     

    I tried to change copying and pasting your formula but It still dont work. As you can see in the print attached to this post, I tryed to apply a new picture to my profile and it still shows an error.

     

    Can you help me once again?

    Thank you again 

     

     

    error 2.PNG
  • Verified answer
    RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @Anonymous 

     

    If you copied and pasted the formula I gave directly, I see now that there is a syntax error in it.

    //send photo to office365 profile, complete photo task in outlook tasks, patch the local copy with completed task, update local copy of user profile to reflect new photo
    
    Office365Users.UpdateMyPhoto("image/jpeg", 
     UploadedImage1.Image);
    
    Set(_myProfile, Patch(_myProfile, {userPhoto: UploadedImage1.Image});
    
    Reset(AddMediaButton1);
    Clear(TempProfileColl)

    It was missing a semicolon on the UpdateMyPhoto function.

     

    See if that is the issue you are having.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hello, Now it says "The function 'Clear' has some invalid arguments."

     

    Can you help me out?

     

    Thank you once again.

    Error 3.PNG
  • Verified answer
    RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @Anonymous 

    It is probably that you no longer have a TempProfileColl

    I left that statement in the formula only because I did not know if you were somehow using that elsewhere in the app.  My guess is that you are not and that entire Clear(TempProfileColl) line can be removed from the formula.

     

     

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    It worked! It missed one ")" but I found it! And it all works now! I cant thank enought for all of your help!

     

    Kings regards!

     

  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    Happy to help!!

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 530

#2
WarrenBelz Profile Picture

WarrenBelz 459 Most Valuable Professional

#3
Haque Profile Picture

Haque 314

Last 30 days Overall leaderboard