Hello,
Below is a complete flow that I built with a shorter list of stores just for testing.
The complete flow
Step 1- List Rows from the table that contains the stores to be excluded.
The Excluded Stores table in dataverse that this applies to looks like this:
The StoreID column is the Primary Column and has the logical name be_name
Step 2 - Create a flat file array
This step creates the flat array of Store ID's to exclude further down the flow. The output of this step looks like this:
Step 3 - List all the stores from the main list, I created a simple table with one column and 3 entries, just for testing
The testExcludes table looks like this, single column (StoreID). This column is the Primary Column for this table and also has a logical name of be_name.
Step 4 - Select action to assign the flag
Takes the output of the "List rows - All Stores action" for the From field - outputs('List_rows_-_All_Stores')?['body/value'] - and creates the following two Maps:
- Store ID > item()?['be_name'] (Power Automate then translates that to StoreID)
- flag > not(contains(outputs('Select_-_Exclude_List'),item()?['be_name']))
The output is as follows:
[
{
"Store ID": "47777",
"flag": true
},
{
"Store ID": "48748",
"flag": true
},
{
"Store ID": "45999",
"flag": true
}
]
This is where I think the error occurs, issue is. Store ID 47777 should not be set to true as it's one of the stores in the Exclude List
Step 5 - Filter the array to only show stores with a flag = true
Takes the oupt of the Select action for the From field - body('Select')
Output is of course the same as the Select action