Skip to main content

Notifications

Power Automate - Building Flows
Answered

Create multiple html tables from array based on matching values

Posted on by 18
Hello, I am looking for some help on creating a flow that will output multiple html tables in an email, but the tables will be separated based on matching values from the parsed json array. I have been working on this for a few days but cannot get the output right, or any output. I know I will need to use loops + variables to be able to match values and create the multiple tables. Unfortunately, I cannot copy my flow as it contains confidential information. I have created an example array/schema below and the expected/desired output. The matching value = Desc.
 
****As additional information, I am running a query against a powerBI data set, then parsing the json as shown below. Using ChatGPT, I just run into more problems. Thanks in advance!
 

Sample parsed json
 
Content  
{
    "DataTable[Name]" "Ben",
        "DataTable[Desc]" "Male",
        "DataTable[Value] "19" 
  },
  {
    "DataTable[Name]" "Pip",
        "DataTable[Desc]" "Male",
        "DataTable[Value] "99" 
  },
  {
    "DataTable[Name]" "Chaz",
        "DataTable[Desc]" "Alien",
        "DataTable[Value] "1" 
  },
  {
    "DataTable[Name]" "Han",
        "DataTable[Desc]" "Mutant",
        "DataTable[Value] "7" 
  },
  {
    "DataTable[Name]" "Luke",
        "DataTable[Desc]" "Alien",
        "DataTable[Value] "4" 
  }

Schema
{
    "type": "array",
    "items": {
        "type": "object",
        "properties": {
            "DataTable[Name]": {
                "type": "string"
            },
            "DataTable[Desc]": {
                "type": "string"
            },
            "DataTable[Value]": {
                "type": "integer"
            }
        },
        "required": [
            "DataTable[Name]",
            "DataTable[Desc]",
            "DataTable[Value]"
        ]
    }
}
 
Desired Output
 
Desc: Alien
Name Value
Luke 4
Chaz 1
   
Desc: Male
Name Value
Ben 19
Pip 99
   
Desc: Mutant
Name Value
Han 7
  • ChazTime Profile Picture
    ChazTime 18 on at
    Create multiple html tables from array based on matching values
    This worked! Thank you for the details! I was able to work through some issues. My flow had most of these items but in the wrong places! Thank you again!!! @Sudeep!
  • Verified answer
    SudeepGhatakNZ Profile Picture
    SudeepGhatakNZ 14,123 on at
    Create multiple html tables from array based on matching values
    Hi there,
     
    Use this flow. You can also download it from here.
     
     
     
    Output:

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,591

#2
RandyHayes Profile Picture

RandyHayes 76,308

#3
Pstork1 Profile Picture

Pstork1 64,090

Leaderboard