Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Building Power Apps
Answered

LookUp Corresponding Record in a Dataverse-related Flow (Power Automate)

(0) ShareShare
ReportReport
Posted on by 402

I’ve successfully set up Relationships between two tables within Dataverse, and I know these work correctly (via Forms in a Model Driven App, and via Galleries in a Canvas App (both Apps set to refer to the same Dataverse tables at source)). Given the relationships are at the data layer, I had anticipated that a Flow (in Power Automate) would understand that one table is related to another. I can’t identify this functionality and additionally, it seems both nonsensical and in fact impossible within Flow to introduce a step to look up a record on a corresponding table – since the GUID for the corresponding record in a second table is not known and can’t be determined.

 

I’ve attached a screenshot of a very basic Flow, which is triggered during a Business Process Flow run from within a Model Driven App (formal trigger name is: “When a flow step is run from a business process flow”). The Flow ‘knows about’ the master record to work on, given this record is already related to the BPF – in this example, the Table is EquipmentOrders. To test this, I put an attribute, ‘Quantity’, in to a Compose – and the correct value was presented on run of the Flow.

 

However, the intention of this Flow is that when submitted, the stock level of the equipment ordered by the user, stored in table EquipmentStockQuantities, will be reduced. Normally when using SharePoint as the data source, I would expect to apply an OData filter at this step and filter using dynamic data to grab one unique row. However, these two tables are related at the data layer in Dataverse so I can’t see why this is necessary in Flow. The BPF or the Flow will not know the GUID of the appropriate row in EquipmentStockQuantities and as that’s the primary key, that’s how I’d want to identify the correct row.

 

Not shown, but for completeness, the action ‘Update a row’ wants the Row ID – same problem in that I don’t have it. 

Another [inefficient but again for illustrative purpose] could be that I use the List rows action for table EquipmentStockQuantities and retrieve all the records on the list, but again, I can’t see how I would then refine that list to identify the single record to update (using OData filtering etc) since the GUID doesn’t seem to be known to the Flow – even though the two tables are related.

 

I’m sure there must be a very straightforward solution to this, as this seems fundamental to being able to work routinely with two related tables and two related records in Dataverse, but I can’t spot it and all my research hasn’t revealed it. Can anyone advise how the appropriate (related) record in the second table, EquipmentStockQuantities, can be reliably located by the Flow and updated accordingly?

 

Thank you very much for any assistance!

  • Verified answer
    pp365 Profile Picture
    402 on at
    Re: LookUp Corresponding Record in a Dataverse-related Flow (Power Automate)

    For the benefit of anyone reading this thread in the future, the method I described in the original post is possible and is explained in @lisacrosbie 's brilliant "Power Apps Model Driven Apps" YouTube video in Module 11: Additional Process Automation.

     

    A direct link to the video and chapter is: https://youtu.be/LIC8DFW8fOE?t=11134 . I highly recommend this entire video, a fantastic resource.

  • pp365 Profile Picture
    402 on at
    Re: LookUp Corresponding Record in a Dataverse-related Flow (Power Automate)

    The source record is in Table EquipmentOrders. I want to look up the corresponding record in Table EquipmentStockQuantities in order to reduce the stock level for the equipment type on the record in EquipmentStockQuantities when an order is placed.

     

    I have already set up a relationship in Dataverse between EquipmentOrders and EquipmentStockQuantities. But I cannot see how to relate the two tables in Flow to perform the above desired requirement.

     

    I want to do this using the GUID if possible to ensure that the exact record is located - not a speculative search on, for example, 'Name', as there could be more than one equipment type with the same name.

     

    Does this help? Thank you very much @Bilakanti 

  • Bilakanti Profile Picture
    1,226 on at
    Re: LookUp Corresponding Record in a Dataverse-related Flow (Power Automate)

    @pp365 - You need to filter Equipmentstockquantities table using the column that is present in Equipmentstockquantities right?

     

    Bilakanti_0-1674653284472.png

     

  • pp365 Profile Picture
    402 on at
    Re: LookUp Corresponding Record in a Dataverse-related Flow (Power Automate)

    Hi @Bilakanti , thanks for replying.

     

    Would you be willing to share some additional details on the methodology for this as I have no idea what you mean. Anything further you can share would be great.

     

    The wider question still applies though: surely this basic requirement must be possible via the Power Automate UI (even in the form of some expressions at the most complex). Surely it can't be the case that this can only be done via a form of CLI?

     

    Thank you!

  • Bilakanti Profile Picture
    1,226 on at
    Re: LookUp Corresponding Record in a Dataverse-related Flow (Power Automate)

    @pp365 I would recommend you to build the query using fetch xml and then add the same fetch xml query in your list and pass the id dynamically.

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

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,708 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 66,030 Most Valuable Professional

Leaderboard