Updating Entity Reference Power Automate vs Plugin

Recently I worked on a project where not a single line of code was allowed. It was only configuration project. I had a requirement to create number of custom tasks at run time based on the task template. Since plugin was not allowed, used Power Automate(Flow).

While I started working on power Automate, I had to check the syntax for all small things which are on my finger tips when I write the plugin. Hence thought of posting about such syntaxes. Here are few quick help when we create a power automate instead of plugin.

Updating entity reference field

in Plugin if I am updating the regarding field of the task with the case ID

ActivityEntity.regardingobjectid= new EntityReference("incident", targetIncident.Id);

If we want to do same thing in Power Automate, we need to set it in different way

We need to either enter something like below

incidents(Guid) or /incidents/Guid

Updating Owner field

If we want to update the owner of the entity in plugin, we easily do it as mentioned below

// for Team a owner 
ownerId = teamId!=Guid.Empty?new EntityReference("team", teamId):null;
// for User a owner 
ownerId = userId!=Guid.Empty?new EntityReference("systemuser", userId):null;

Again if I want to do that in Power Automate, I have to follow steps and coding.

On similar lines, we also write teams(Owner(value)) if the owner is of Team type.

Ideally, we should be able to get the Owner(type) from Owner of the current entity and assign that value here as

Somehow I am getting Owner type as blank. Might need to confirm if this is one of limitation of the Current connector. Will update the post once get the more details here.

Till that time happy power automating 🙂 Enjoy new learning!