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

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Top Solution Authors
Top Kudoed Authors
Users online (63,524)