Skip to main content

Notifications

Power Automate - Building Flows
Answered

multiple related dataverse tables - with conditions and variables!

Posted on by

HI All

 

I'm an absolute beginner and struggling with a flow to automate a process in my app. 

 

I have 4 Data verse tables. A "Header" table which creates an auto-number, and has a lookup to a "customers" table. A "Details" table which has a parent/child relationship to the header table, and also a lookup to a "products" table.  So it's basically like an orders app, except in this case it's items being returned to us.  I want a flow that sends an email eventually to the person responsible for processing the return, so needs to have the auto-number, the customer details, the details of the products being returned, and the type of return to be processed.

 

I have my trigger as a modify record in the headers table (added a field to say when "completed") - and I then need to pull in the customers, and the details of the return (can be several rows) (and so also the products table!).   I also have a choices column in my details table which specifies which type of return....  I tried initializing a variable using some help from online, but although it says it succeeded it's not showing the result.

 

Here's what i have:

rowan_preston_0-1651176890713.png

rowan_preston_2-1651176972894.png

rowan_preston_0-1651177292901.png

But although it says it ran successfully - this is my result...  the detail lines are both listed correctly, but the "TYPE" should be a column on the end!  My variable is blank!

rowan_preston_3-1651177583053.png

rowan_preston_2-1651177497164.png

Apologies for the long post - any advice/help greatly appreciated!

  • Re: multiple related dataverse tables - with conditions and variables!

    Wow - I cannot thank you enough!  This just made my day!!!  Something I have been struggling with for DAYS and you solved it in a minute.  Thank you so much!!

  • Verified answer
    WillPage Profile Picture
    WillPage 1,881 on at
    Re: multiple related dataverse tables - with conditions and variables!

    Add a Select action after your List Rows. Put the output of the list rows into the Select and add the key value pairs for the columns you want to keep. Much like what you've done with the Create HTML Table but name the column headers (they can't be blank) and in the RA Type column add the expression item()?['rp_ratype@OData.Community.Display.V1.FormattedValue'] or find its dynamic content.

    Next, go Filter array and filter the output of that Select for item()?['RA Type'] is equal to Credit assuming you named the column RA Type in the previous Select action. You can then convert the result of that to HTML but you don't need to manually select the columns any more because you already did that in the Select.

  • Re: multiple related dataverse tables - with conditions and variables!

    Hi - thanks for your reply.

     

    Yes - that's exactly what I would like to do!  have just the credits show in the table and it will be emailed to one person, and if its not a credit a similar filtered table will be emailed to a different person.

  • WillPage Profile Picture
    WillPage 1,881 on at
    Re: multiple related dataverse tables - with conditions and variables!

    Your Compose 2 action inside Apply to each has the expression written as text instead of in the expression editor. Having said that, it's not clear what you're doing with that outside of the Apply to each.

    Despite that, your flow structure needs a bit of work. If you had a value in the RA Type variable it will be a static value and appear the same for each row of the HTML table. Are you trying to expand the value of that choices column and filter the list by its value so only items with RA Type = credit are shown in the HTML table?

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

November 2024 Newsletter…

November 2024 Community Newsletter…

Community Update Oct 28…

Power Platform Community Update…

Tuesday Tip #7 Community Profile Tips…

Welcome to a brand new series, Tuesday Tips…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 143,246

#2
RandyHayes Profile Picture

RandyHayes 76,308

#3
Pstork1 Profile Picture

Pstork1 63,884

Leaderboard