cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
mrpowergage
Resolver I
Resolver I

How to assign ownership of record from User email

I'm trying to create a new task for a user as defined in an excel table, with the users email address.

 

I'm having difficulty getting setting the owner useing Create a New Record. The below gives a 404 error:

"systemuser With Id = 7a61d442-27a6-4196-8f7a-80e0aecb1471 Does Not Exist"

 

Power_Apps.png

I know the user exists (in this case it is me), the 'Get user profile' step returns the correct record.

 

I have tried not defining the owner type, but that gives a differnt error. I have also tried useing create record in CDS  with the same result.

 

All help appreciated. Thanks

1 ACCEPTED SOLUTION

Accepted Solutions

@mrpowergage 

No problem at all.  So, the unique identifiers for Office 365 won't be the same as for D365, so using the ID field from your "Get User Profile" won't translate...it won't find a match.  The fix is to find something the two have in common, like the email address, to help link it.  If you are only using the Get User Profile step to get the ID (not using other bits), then you can probably get rid of it and replace it with the Common Data Service (CDS) step below:

20200115c.PNG

 

Here, I am asking CDS to list all the records where the internalemailaddress matches the email address from my trigger.  You can replace that with the email address for the Dynamics user you need the ID for (don't forget the single quotes).

 

Then, in the Create Record Step, you would use the "User" field from the List Records as the ID in the Owner field, and that should give you the correct result.

20200115d.PNG

 

Note, that because Power Automate is expecting multiple results from the "List Records" step (even though there should be only one match), it will want to put the next step in an Apply to Each loop.  The way around this is to use First() to let it know you only want 1 element of the expected Array.   Check out Elaiza Benitez' video on that here.

 

You're very close, keep at it 🙂

Keep us posted.

-Ed-

 

If you liked this reply, please give it a thumbs up! If this reply has answered your question or resolved your challenge, please consider marking it as a Solution. This helps other users find it more easily via search.

View solution in original post

5 REPLIES 5

@mrpowergage 

Hi there.  So, the GUIDs used in Office 365 don't correlate to the ones used in D365.  You'll want to add an interim step to get the user record, maybe using their email address, and use that ID as the owner in your create a record step.

 

Also, have you already considered using the CDS connector vs. the D365 connector?  It will give your flow additional functionality as well as longevity.

 

Hope this helps, keep us posted.

-Ed-

 

If you liked this reply, please give it a thumbs up! If this reply has answered your question or resolved your challenge, please consider marking it as a Solution. This helps other users find it more easily via search.

Thanks @edgonzales 

 

Forgive me if this is obviouse: please could you clarify what you have in mind for this "an interim step to get the user record, maybe using their email address, and use that ID as the owner in your create a record step."

 

I have the dynamics user email, what step can I use that to get their GUID?

 

Thanks for the advice re CDS connector, I'll use that.

@edgonzalesI think I've solved my question. This is my solution, was it the sort of thing you had in mind?:

 

Power_Apps.png

@mrpowergage 

No problem at all.  So, the unique identifiers for Office 365 won't be the same as for D365, so using the ID field from your "Get User Profile" won't translate...it won't find a match.  The fix is to find something the two have in common, like the email address, to help link it.  If you are only using the Get User Profile step to get the ID (not using other bits), then you can probably get rid of it and replace it with the Common Data Service (CDS) step below:

20200115c.PNG

 

Here, I am asking CDS to list all the records where the internalemailaddress matches the email address from my trigger.  You can replace that with the email address for the Dynamics user you need the ID for (don't forget the single quotes).

 

Then, in the Create Record Step, you would use the "User" field from the List Records as the ID in the Owner field, and that should give you the correct result.

20200115d.PNG

 

Note, that because Power Automate is expecting multiple results from the "List Records" step (even though there should be only one match), it will want to put the next step in an Apply to Each loop.  The way around this is to use First() to let it know you only want 1 element of the expected Array.   Check out Elaiza Benitez' video on that here.

 

You're very close, keep at it 🙂

Keep us posted.

-Ed-

 

If you liked this reply, please give it a thumbs up! If this reply has answered your question or resolved your challenge, please consider marking it as a Solution. This helps other users find it more easily via search.

The perfect solution is the one that works, right?  Great job!

 

So, you may notice that this one might be a bit slow because it will go through all of the user records one at a time before completing.  If that's not an issue, then you're golden.  If it turns into a thing, then check out my version above.  As long as it's working for you, then we're all stoked! 🙂

 

Well done!

-Ed-

 

 

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

May UG Leader Call Carousel 768x460.png

June User Group Leader Call

Join us on June 28 for our monthly User Group leader call!

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

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

Power Automate Designer Feedback_carousel.jpg

Help make Flow Design easier

Are you new to designing flows? What is your biggest struggle with Power Automate Designer? Help us make it more user friendly!

Users online (1,203)