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

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Suggested answer

PowerApps, Cloud Flow: get entity by ID to update lookup column

(0) ShareShare
ReportReport
Posted on by 25

Hello everyone,

In a model driven app, I'm creating a cloud flow that automates updates and inserts. I have an entity "car". The user select a type of wheels for the car. This type of wheel consists of three parts. So, the three parts get added to a related entity called car-parts. The car-parts entity links cars and parts. There is a relationship, and a lookup for car on the car-parts entity, because car has a subgrid that shows the parts.

Now, when I add the wheel parts to the car-parts entity from a cloud flow, I need to fill the lookup on the car-parts entity with the car entity. This, however, seems impossible. I have all the car data, every attribute of it, including the ID. But I can't use it for filling the lookup column of the car-parts entity.

Is there any way to retrieve the car entity with an expand query or some form of fetch XML notation? Maybe a formula of some sort that gets an entire entity by its ID? I've tried linked-entity, with fetch XML, to retrieve the car entity from a shared entity, but apparently I can only get the car entity from a car lookup column in another entity, even though I have the complete set of attributes of the car entity already.

Thanks in advance for any hint or tip.

Best regards,
- Alex.

I have the same question (0)
  • Suggested answer
    Timothy Bohte Profile Picture
    44 on at
    RE: PowerApps, Cloud Flow: get entity by ID to update lookup column

    Hi Alex,

    You can also relate the two records directly in the step where you create the car part. In that step, there should be a field for Car, something like Car (Cars). In that field you fill in system name of the table adding an s and a (, something like this: prefix_cars(

    Then you add the Id of the car via Dynamic content. It would be something like Car. This is the GUID.

    Then you add a closing ).

    So for eksempel: prefix_cars(Car)

    In this way you relate the created Car part records directly with the Car record from the previous step. This is environment aware, so you should be able to import it to your other environment without problems or adjustments.

  • akersk Profile Picture
    25 on at
    RE: PowerApps, Cloud Flow: get entity by ID to update lookup column

    Hi Timothy,

    Thanks for your reply! I tried a different approach before I read your answer. Your solution might work, though.

    What I did was, filling the car parts table with the correct parts, and update the relationship of the created rows in a separate, subsequent step. This works wonders. I can use the ID of the car that I already had.

    I do have an additional question about this though. You can use the OData ID from a previous step. So, I use a get rows DataVerse action that retrieves only the rows that I just added to the parts table. With a subsequent step I update the relationship using an Update Relationship action. This last action asks for either the OData ID, or an URL to the entity you want to update.

    Currently, I'm using the URL option with a variable part that inserts the ID of the object that I want to update. However, the Odata way would be preferable. The URL contains a link to a specific version of the API, and a specific domain. So, if I were to deploy the solution from a development environment to a production environment, the URL would have to be updated in the production environment. 

    How would I use the OData notation to do this? Simply adding the "dynamic data" OData ID to the field doesn't work. I tried looking for examples as well as documentation. So far, I only read that I would simply put only the OData ID in that field. But something more is obviously necessary.


    Best regards,
    - Alex.

  • Suggested answer
    Timothy Bohte Profile Picture
    44 on at
    RE: PowerApps, Cloud Flow: get entity by ID to update lookup column

    Hi Alex,

    The Cloud flow should be triggered on the Type of wheels collumn on the Car table. This automatically gets the Car records Id collumn. If not, empty the Select collumns box in the trigger or add the collumn as _*collumn name*_value,

    This should do the trick. If you still encounter problems, please share a screen shot of the flow design.

    Regards

    Timothy 

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Andrés Arias – Community Spotlight

We are honored to recognize Andrés Arias as our Community Spotlight honoree for…

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Daniyal Khaleel Profile Picture

Daniyal Khaleel 141

#2
DAnny3211 Profile Picture

DAnny3211 134

#3
Abhilash Warrier Profile Picture

Abhilash Warrier 70 Super User 2025 Season 2

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans