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 Automate / Trying to get PA to lo...
Power Automate
Unanswered

Trying to get PA to lookup values from another table and append to excel

(0) ShareShare
ReportReport
Posted on by
I have a PA cloud flow that I need help with obtaining the result that I'm looking for.  This flow is used to track quotes that my customer service group produces.  It uses AI to extract data from messages that are sent, and then writes that to an excel file in teams.  That has been working great.
 
The new wrinkle, is to extract the specific item #'s that are on the quote, look them up in another table to find their "parent category" for each item, de-duplicate any "parent categories" that may occur, then write the final csv list of values to a cell in the spreadsheet for that quote.  There can be from 1-100 unique items that are on each quote.  
 
I'm not sure if I need to use variables to store the items.  I've searched and tried different thinks for 2 days and can't figure it out.
 
The JSON data looks like this:
 
{
    "body": {
        "@odata.type": "#Microsoft.Dynamics.CRM.expando",
        "Quote_00f0f958f48add15e958322fbcc46d9eac": "number",
        "Quote_00145740ba4fa2efb511d9748ae2c663ca": "date",
        "Quoted_0a3a6d849c26b3a8fec5c0d3ec830d384": "text",
        "Account_bf2a09892f3c04ef9b1ce9f9f24c4cb5": "number",
        "Sold_00227bdcdc59631e17b0182cb7c8fd6906c": "text",
        "Sold_0027530adb08d8af3e1e70737c74d1ea8be": "text",
        "Sold_002e065bc3f4dcfea185d8f6bf89eddf581": "text",
        "Ship_002b89dffd764194ce322722a6a3349a6ec": "text",
        "Ship_002372254143dd5890be5c33bd2e01bd55c": "text",
        "Ship_0025d0fae6e56dd6ce50a6187f0b3cf1da9": "text",
        "Total_00809d0fb61b4acec40ff234df9712240d": "number",
        "Unique_02ff64eec8a084688932a44cdc68231bc": 3,
        "Unique_054b577512a8381a912b01680b8d71817@odata.type": "#Collection(Microsoft.Dynamics.CRM.crmbaseentity)",
        "Unique_054b577512a8381a912b01680b8d71817": [
            {
                "@odata.type": "#Microsoft.Dynamics.CRM.expando",
                "item": "PRB67"
            },
            {
                "@odata.type": "#Microsoft.Dynamics.CRM.expando",
                "item": "PRB612"
            },
            {
                "@odata.type": "#Microsoft.Dynamics.CRM.expando",
                "item": "B909"
            }
        ]
    }
}
 
and would end up with a result of "Batteries, Tags" if everything went according to plan.  (PRB67=Batteries, PRB612=Batteries, B909=Tags)
 
 
Categories:
I have the same question (0)
  • narayan225 Profile Picture
    2,547 Super User 2025 Season 2 on at
    You can do the following:
     
    1. Add an action to get the name of the products based on the item value from the JSON.
    2. Store the names in an array in a new action.
    3. Create a union of the array with itself to remove duplicates. Formula: union(varaibles('array'),variables('array'))
    4. Add an action to append the strings using ", " from the returned array.
    5. Then update the row to have the values.
    Hope this helps.
    Cheers!
  • Chriddle Profile Picture
    8,443 Super User 2025 Season 2 on at
    If you query the categories with xpath, you don't need the loops and filters:
     
     
    Select
    From: @{outputs('Compose_Item')}
    Map:
    xpath(
    	xml(json(concat('{"Root": {"Item": ', outputs('Compose_Cat'), '}}'))),
    	concat('string(//Item[item="', item(), '"]/Cat)')
    )
    Compose
    join(
    	union(body('Select'), json('[]')),
    	', '
    )
     

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 Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 501 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 323 Moderator

#3
abm abm Profile Picture

abm abm 237 Most Valuable Professional

Last 30 days Overall leaderboard