cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
amansharma_751
Frequent Visitor

Assign Task directly

I am facing the issue , my task is to when I click on user icon in the attached screenshot, the process in assigned to the login user and the column in the gallery list name as status (this column have different choices such as open, assigned, completed and rework etc.) is change from open to assigned and in assignee column show the name of the login user. Thanks in advance, I am new in power apps. 

1 ACCEPTED SOLUTION

Accepted Solutions
RusselThomas
Microsoft
Microsoft

Hi @amansharma_751 ,

There may be a few variations, depending on what your 'assignee' column is set to.  If it's just a single line of text and you just want to show the name, it's perhaps a little easier than if it's a person or multiperson column.

You can go for Update, UpdateIf or Patch - As an example, let's use Patch and assume the following;

dataSource = Task list which in this example is a SPO List

assigneeColumn = "Assignee" column which is just a single line of text

 

On your user icon OnSelect: property;

Patch(dataSource, ThisItem, {Status: "Assigned", Assignee: User().FullName})

You may want to also build in some logic to prevent someone doing this for something that is already assigned, in which case on your user icon DisplayMode: property put something like this;

If(ThisItem.Status="Assigned", DisplayMode.Disabled, DisplayMode.Edit)

But that's up to you.

If your Assignee column is a person column in SharePoint, you need to create a SharePoint user object for the current user, then use that to patch.  So in your app start, or perhaps just on a button for now to test, set the following;

Set(userSPO, 
{ 
  '@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser", 
  Claims:"i:0#.f|membership|" & Lower(User().Email), 
  Department:"", DisplayName:User().Email, 
  Email:User().Email, 
  JobTitle:".", 
  Picture:"."
}
)

Then you can set your user icon OnSelect: property to;

 

Patch(dataSource, ThisItem, {Status: "Assigned", Assignee: userSPO})

 

Hope this helps,

RT

View solution in original post

1 REPLY 1
RusselThomas
Microsoft
Microsoft

Hi @amansharma_751 ,

There may be a few variations, depending on what your 'assignee' column is set to.  If it's just a single line of text and you just want to show the name, it's perhaps a little easier than if it's a person or multiperson column.

You can go for Update, UpdateIf or Patch - As an example, let's use Patch and assume the following;

dataSource = Task list which in this example is a SPO List

assigneeColumn = "Assignee" column which is just a single line of text

 

On your user icon OnSelect: property;

Patch(dataSource, ThisItem, {Status: "Assigned", Assignee: User().FullName})

You may want to also build in some logic to prevent someone doing this for something that is already assigned, in which case on your user icon DisplayMode: property put something like this;

If(ThisItem.Status="Assigned", DisplayMode.Disabled, DisplayMode.Edit)

But that's up to you.

If your Assignee column is a person column in SharePoint, you need to create a SharePoint user object for the current user, then use that to patch.  So in your app start, or perhaps just on a button for now to test, set the following;

Set(userSPO, 
{ 
  '@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser", 
  Claims:"i:0#.f|membership|" & Lower(User().Email), 
  Department:"", DisplayName:User().Email, 
  Email:User().Email, 
  JobTitle:".", 
  Picture:"."
}
)

Then you can set your user icon OnSelect: property to;

 

Patch(dataSource, ThisItem, {Status: "Assigned", Assignee: userSPO})

 

Hope this helps,

RT

View solution in original post

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

secondImage

Demo Extravaganza Winner Announcement

Please join us on Wednesday, July 21st at 8a PDT. We will be announcing the Winners of the Demo Extravaganza!

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Top Solution Authors
Top Kudoed Authors
Users online (4,181)