cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
NurNina
Post Patron
Post Patron

Change owner of activity in canvas apps

Hi I have a question. Can I change the owner of task/activities inside a canvas apps? I know we can change the owner of activity in model-driven but for canvas apps, would I be able to do it?

20 REPLIES 20
v-siky-msft
Community Support
Community Support

Hi @NurNina ,

 

Use Patch function to modify the Owner of activity record.

Patch(Acts,First(Acts),{Owner:LookUp(Users,'Full Name'="Xin Dai")})

Note: Acts is my activity entity name, I change the owner to Xin Dai.

Snipaste_2019-12-30_18-13-34.pngIn order to Change Owner on a Task/Activity, you have to assign the following permission at least.

  • Create, Read, Write, Append & Assign Permission on Task (based on BU where the end user is resides)
  • Append To on Lead
  • Append and Append To on Users entity

Sik

What if I want to let the user that change the owner of activity? from dropdown probably?

@NurNina,

Of course.

Add a combo box,

set items property: Users

set OnChange property: Patch(Acts,First(Acts),{Owner:ComboBox1.Selected})

Snipaste_2019-12-31_17-57-24.png

Sik

I have an error in which it says that the owner id value is not allowed to be updated. Why is that? 

Hi @NurNina ,

 

Could you share the screenshot of error information?

Which the security role were your account assigned?

What is the original owner of activity, and who do you want to change to?

 

Please ensure you have enough permission to User entity, and you can change your security roles to System Administrator and then check if your issue still remains.

 

  • Click Settings, click Users+ permissions, and then click Users.
  • Select the user and click Manage Roles to reassign the security role.
  • assign System Administrator to user

Snipaste_2020-01-01_11-47-26.png

 

Sik

error owner.PNG

 

this is the error that I received. im trying to let user to change the owner of his activity to other user inside the canvas apps. 

Hi @NurNina ,

 

Owner field can refer to a record from either the Teams entity or the Users entity. Not every record in these entities has permission to be an Owner; check the supported roles if you still run into a problem. Try to change anther user.

Reference: Update the owner by using Patch 

Sik

lfinman
Advocate I
Advocate I

@NurNina Were you able to get this working?  I am running into the same error you mentioned, and I am a System Administrator.  I cannot change the owner of an Activity or Task from my canvas app, regardless of whether I work with 'Owner' at the Activity level, 'Owning User' at the Task level, etc.

 

@v-siky-msft Was your example from a canvas app with Common Data Service data source?  I get the following errors in my Canvas App on a Patch for Activity and Task:

 

For a Task (renamed 'Tasks-Memos'):

Patch ('Tasks-Memos', Gallery1.Selected,{owninguser_task:ComboBox1_1.Selected})

Error message:

owninguser_task: The specified column is read-only and can't be modified

 

For an Activity:

Patch (Activities, LookUp(Activities,Activity=Gallery1.Selected.Task),{Owner:ComboBox1_1.Selected})

Error message:

Column '_ownerid_value' is not allowed to be updated

 

I am beginning to think this must be done with Flow triggered from the Power App?

@NurNina or anyone else checking on this topic:  I was able to change the owner of myactivity using a Flow/Power Automate triggered from the Power App (directions here: Start a flow in a canvas app ).  Would still prefer to change the activity owner directly in the Power App if anyone can confirm that is possible.

Helpful resources

Announcements
PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

PWREduCon768x460.png

Join us at PWR EduCon - A Power Platform Conference

Learn from the top Power BI, Power Apps, Power Automate & Power Virtual Agents experts!

Top Solution Authors
Top Kudoed Authors
Users online (3,118)