cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
BrianSlalomMS
Helper II
Helper II

How to test CDS record ownership in a Flow?

I need to change the Owner on over 10,000 records in my custom CDS entity. I want to change the owner of all records currently assigned to a particular owner, me in this case.

I’m trying to do this with a Flow but have not found a way to test the current owner. I get the user id of my User record and try to compare it to the id of the current owner using owninguser/systemuserid as shown here.

FlowImage.png

 

The above generates this error “The Property systemuserid is not a primary key of the related entity”.

 

I also tried using comparing to the identityid field of the associated owning user, like this,

FlowImage2.PNG

but get this error.

“A binary operator with incompatible types was detected. Found operand types 'Edm.Int32' and 'Edm.Guid' for operator kind 'Equal'.”

 

And I tried comparing to the ownerid field from my custom entity record as well.

FlowImage3.PNG

But get this error,

“A binary operator with incompatible types was detected. Found operand types 'Microsoft.Dynamics.CRM.principal' and 'Edm.Guid' for operator kind 'Equal'.”.

 

How can I test that a record is owned by a particular user?

1 ACCEPTED SOLUTION

Accepted Solutions

Thanks for that troubleshooting tip. The field I needed is _ownerid_value so

_ownerid_value eq <the user record id>

worked.

Thanks.

View solution in original post

3 REPLIES 3
v-bacao-msft
Community Support
Community Support

Hi @BrianSlalomMS,

 

I think you could configure List records not configure Filter Query, output the body of List records, see what the corresponding column display name is.

It seems that the name "owninguser/systemuserid" is displayed in the odata query is not the one you configured.

Take a try.

 

Best Regards,

Barry

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
GabrielStJohn
Community Champion
Community Champion

Hello, @BrianSlalomMS!

Thank you for posting on the Flow Community Forum! Have you had an opportunity to apply @v-bacao-msft‘s recommendation to adapt your Flow? If yes, and you find that solution to be satisfactory, please go ahead and click “Accept as Solution” so that this thread will be marked for other users to easily identify!

Thank you for being an active member of the Flow Community!

-Gabriel
Flow Community Manager

- Gabriel
Community Manager
Power Automate | Power Virtual Agents
Super User Program Manager



Thanks for that troubleshooting tip. The field I needed is _ownerid_value so

_ownerid_value eq <the user record id>

worked.

Thanks.

Helpful resources

Announcements
Register for a Free Workshop.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

September Events 2022

Check out all of these events

Attend in person or online, there are incredible conferences and events happening all throughout the month of September.

Users online (1,924)