How to get assigned user from an action center task?

I’m trying to fetch all action center form tasks, loop through them and check the email of the user the task is assigned to. I have several form in my action center that are pending.

This is what I’m using to fetch the tasks

I’m trying to user Item.AssignedToUser to fetch the email information, but for some reason it is null, where as the rest of the values such as Item.Id, Item.status, Item.AssignedToUserId exist

Any help would be greatly appreciated.

Hey @Simon_Fu

Are you expanding the Assigned User here ?

Thanks
#nK

What do you mean by expanding the assigned user? From the last screenshot AssignedToUser is null and cannot expand for additional information.

Hey @Simon_Fu

I was able to get it, Is that due to access I’m just thinking ?

Thanks
#nK

Are you able to get the values under assignedToUser within Studio?

Hey @Simon_Fu

I can’t try it in studio as of now due to my infrastructure restrictions.

You are using which activities ?

Thanks
#nK

I’m using the Get Form Tasks activity and as per my second screenshot, and logging each task that is returned.

What website did you use to test the API call from your earlier response?

Hey @Simon_Fu

It’s from the Orchestrator Swagger

{{Orch_URL}}/swagger

Try this once and check, if not we will look for alternatives

Thanks
#nK

It works in swagger.

Since it seems difficult to figure out why AssignedToUser is null, I believe I can work with an alternative solution. I can get the ID of the user by using item.AssignedToUserId, and use the api “/odata/Users(item.AssignedToUserId)” to fetch all information about the user.

Hey @Simon_Fu

Yep, That can be done. But obviously Get Form Tasks should work.

And I believe the activity will return a collection of tasks output, which is like one service call will get all the details. But with API we may need to do multiple calls which is not looking good.

I hope you are not using any preview version of the activities, right ?

Thanks
#nK

No I am not using any preview version of my activities, although is there a way to check whether I am just to confirm?

1 Like

Hey @Simon_Fu

You can just check in the project panel under dependencies if there is any package suffixed with preview keyword.

In your case, it’s the persistence package.

Thanks
#nK

image

Seems to not be a preview activity. Perhaps this is just a bug with the activity…

Yep, may be @Simon_Fu

We will need to confirm with few more users to confirm the bug !

Thanks
#nK

@Simon_Fu I guess you can get assigned user id only when you assign that task to a specific user id. Try assign that task to a specific user, use the below video. Then try to retrieve assigned user

I’ve tried both assigning through the activity and through action center, both have the same problem unfortunately.

This topic is already old, but for those who are wondering.

With the Get Form Tasks you only get a list of tasks according to your filtering. Each individual task only contains minimal information about the actual task. So several of the usually tags you can use with a TaskObject are still null.

If you want all the data of any specific task you have to use the Get Task Data activity (input is a TaskID, which you can get from the results of your Get Form Tasks activity). Then you can get all the information that is contained within the task, like the assigned user.