web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / SetOwner by a Cloud Flow
Power Apps
Answered

SetOwner by a Cloud Flow

(0) ShareShare
ReportReport
Posted on by 13

Hello Community,

I'm a real beginner in PowerApps and i have a challenge i can't resolve by my own.

 

I have an Excel file that i import to Dynamics Sale365 . That file contains Account Data. The challenge is to set the Owner of the Account to the user that is a column in my Excel file . 

I import the information in  an auxiliary field (strHilfsfeldOwner). The Dataflow import in the information to that field . For that everything is ok. 

Now i want to insert this value to the owner field in Account, for that i use a cloud flow . Trigger on "insert or modify" -> Action "modify row" . Entity " Account" , primary Key " Account UID", setting "strHilfsfeldowner" to the field Owner.

 

I tried it with the " Name of the user" the internalemail of the user and the GUID that i find in the table "User" but i always get an error "Resource not found for the segment".

 

What are the to-Do to import the owner per excel file ? Which should i use in the excel file (mailadresse, name, uid)?  On the entity account is a key on the internal mailadress .

Or must i change the cloud-flow but what are the steps to set the owner field?

 

Many questions . I hope i get a simgle answer.

 

Thanks for your help

 

Marcus

I have the same question (0)
  • cchannon Profile Picture
    4,702 Moderator on at

    I think there's a couple things going on here.

     

    First, a note on the datatypes in play. The Ownerid column is of type Entity Reference (technically it is a special kind of ER, but we'll ignore that for now) and can only accept that kind of data. An Entity Reference is composed of an Entity Type and an Entity Id (technically a Name too, but that is optional). In order to update an Entity Reference from a PowerAutomate Flow, you need to provide it with that correct object, so a name won't work, an email won't work, and a GUID won't work. You need an actual Entity Reference.

     

    Second, "Resource Not Found for the Segment..." is only the first part of your error. That part of an error happens for a lot of reasons, but generally it is the result of telling dataverse to point at something that doesn't exist. So whatever comes after those words is the thing that Dataverse can't find. That is important data.

     

    The cause of your error is probably the result of both things I've noted above or just the second one. It is possible that what you're thinking is a GUID (the ID column you are getting from Flow) is actually already an Entity Reference (Flow tries to hide the complexities of this data type, so usually you just accidentally get the right thing) So let's start with the second one. What is the rest of your error message?

  • MarcusBrueckman Profile Picture
    13 on at

    Hello cchannon

    thanks for that help.

    In the picture below you can see the error when i test the Flow

    MarcusBrueckman_0-1634792848645.png

     
      "error": {
        "code""0x0",
        "message""Resource not found for the segment '2efebc4f-8881-xxxx-xxxx-fexxxxxxxxxx'."
     

    2efebc4f-8881-xxxx-xxxx-fexxxxxxxxxx' is the Azure Object i tried

     

    i tried also User  "62eafa9f-5xd3-exxx-bxxx-0xxxxxxxxxxx"

     

    Both values i get from an export of the table users .

    The way you explain it I would understand it that the error simply says that sales can't resolve the value and can't find a matching record in users and therefore says update not possible.

     

    But which value must be inserted to my excel file or which stepes are necessary in my cloud Flow to set the value? 

    For me it seems necessary to insert a step in the Cloud Flow 

    reading the excel value and make a select to table users to get the right value and put it in the owner field 

    and no idea how this must be done.

     

     

     

     

     

     

  • cchannon Profile Picture
    4,702 Moderator on at

    OK, great. So this is an example of datatype mismatch, which is the first bullet from my post above. You cannot feed a GUID to an EntityReference: they are not the same thing.

     

    Instead try this:

    - Add a step above this one for a Get record by Id and retrieve the account with this Id

    - Then in this step, in place of the record Id, pick the Id attribute that comes back from the Get Record By Id step. That attribute is an EntityReference and should work.

  • MarcusBrueckman Profile Picture
    13 on at

    I have not yet seen how this works but I'll try that the next days

    Thanks already times and if not then I know where I get help.

  • MarcusBrueckman Profile Picture
    13 on at

    I tried that and it work when  i use a static value like systemusers(62eafa9f-5xd3-exxx-bxxx-0xxxxxxxxxxx). But i didnt understand how i can work with a value that i get from a "GetRecord by id" action. I insert this step but how can i work with this result to use it for changing my data field  

  • Ram Prakash Duraisamy Profile Picture
    5,593 Super User 2025 Season 2 on at

    Hello @MarcusBrueckman,

     

    Try using systemusers(getRecordbyid's Owner Field)

     

    Please mark as Answer if it is helpful and provide Kudos


    Subscribe : https://www.youtube.com/channel/UCnGNN3hdlKBOr6PXotskNLA
    Blog : https://microsoftcrmtechie.blogspot.com

  • MarcusBrueckman Profile Picture
    13 on at

    Sorry actually I'm totally confused. 

    Perhaps i try to explain it again

     

    1.  Step
      1. OnChange_OnUpdate on Entity Account -OK
    2. Step :
      1. After that i will insert a step GetRecord from systemusers with a field value coming from a field in the entity account (sprHilfsfeldOwner) in this field there will be the primary mailadress of the user and i will get the userid because
    3. Step :
      1. i want to set the owner in account like i described before systemusers(62eafa9f-5xd3-exxx-bxxx-0xxxxxxxxxxx) but not as a static value 

     

  • Verified answer
    cchannon Profile Picture
    4,702 Moderator on at

    OK, so first, you just get the row by ID where you want the value to come from. In this case, I am just grabbing the User record by Id, since you have a static Guid you mentioned before:

    cchannon_0-1635247012339.png

    Then, you use the record's id as the input to your Update step like so: 

    cchannon_1-1635247070228.png

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 711 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 319 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard