cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper II
Helper II

Iterate through column values on an Excel form?

I created a Flow designed to grab Planner bucket IDs and tasks IDs inside that bucket. The Flow also compiles that list of task and bucket IDs onto an Excel file. Is there a step I can create that iterates through the list of task IDs in the Excel file to see if they repeat? 

 

I'm ultimately trying to create a branch that if a task ID shows more than once, do nothing, but if it is unique, send an email to a user that it exists. Here's the tail end of the Flow.

 

You'll see there's an Apply to Each step that grabs each task and creates an Excel form populating each task ID and its bucket ID. I'm then trying to grab the column and its task ID to compare if the task ID on the Excel form matches the Planner's task ID. 

FlowCap7.JPGFlowCap8.JPG

17 REPLIES 17
Highlighted
Super User III
Super User III

Hi friend you can use filter array to get the values equals to ID then lenght to see how many ID are the same in the list. If the count is more that 1 so you have a repeat ID if is 0 is a new ID

leng.PNG



Did I answer your question? Please consider to Mark
my post as a solution! to guide others :winking_face:

Proud to be a Flownaut!


If you want you can follow me at www.christianabata.com Quieres contenido en español? Síguenos en Power Automate LA
Highlighted
Super User III
Super User III

Hello @angelrodriguez 

 

You can use the expression union() on your array. This will only show unique values.

Example: union(variables('<YourArray>'),variables('<YourArray>'))

 

—Josh
If you like my post please hit the "Thumbs Up" -- If my post solved your issue please "Mark as a Solution" to help others





Did I answer your question? Mark my post as a solution!

If you like my post please hit the Thumbs Up


Proud to be a Flownaut!


Check out my blog for Power Automate tips, tricks, and guides
FlowAltDelete




Highlighted

Hi Christian. Thanks for your response. What is does "tiyulo" represent? I tried using the Filter array step but I keep getting an error that types string and integer are incompatible when I try this.

FlowCap9.JPGFlowCap10.JPG

Highlighted

tiyulo is the name of the colum that I[m getting the array values

for example

NameTiyulo
ValueMy value 1
ValueMy value 2
ValueMy value 2

 

So when you use filter array you need to compare, from List of items when tiyulo is equals to My value 1, so the response gives you only My value 1, and you use length to count that response that is 1.



Did I answer your question? Please consider to Mark
my post as a solution! to guide others :winking_face:

Proud to be a Flownaut!


If you want you can follow me at www.christianabata.com Quieres contenido en español? Síguenos en Power Automate LA
Highlighted

Hi J, thanks for your response. I'm not exactly sure how I would implement union on my array. Am I adding it to the Filter array step or is this a step on its own?

Highlighted

Hello,

Use union on a New Compose action.

Thanks

—Josh
If you like my post please hit the "Thumbs Up" -- If my post solved your issue please "Mark as a Solution" to help others




Did I answer your question? Mark my post as a solution!

If you like my post please hit the Thumbs Up


Proud to be a Flownaut!


Check out my blog for Power Automate tips, tricks, and guides
FlowAltDelete




Highlighted

I guess I'm just not understanding how to use union with just one array. Doesn't union require multiple arrays or objects?

Highlighted

How did you get tiyulo to filter without converting the column into an array?

Highlighted

Hello @angelrodriguez

With the expression union. For both parameters use the same array in both spots.

For example:
union(myarray, myarray)

I use this expression when I need to get unique values from an array.

—Josh
If you like my post please hit the "Thumbs Up" -- If my post solved your issue please "Mark as a Solution" to help others




Did I answer your question? Mark my post as a solution!

If you like my post please hit the Thumbs Up


Proud to be a Flownaut!


Check out my blog for Power Automate tips, tricks, and guides
FlowAltDelete




Highlighted

Josh, thanks again. I added a Compose step with the Union function and added the same array twice like you mentioned.

 

1. You'll see the first image shows the flow process. It ran successfully adding a row for each id in the bucket.

 

2. An Excel list called "TaskIDTracker" collects the ids each time the flow runs. It will repeat ids that were on the last run, and collect the new id (circled in red). 

 

3. The task ID is converted to an array, then I use the Union function "Union(IDarray, IDarray)" to find unique values and that gets dumped into a new Excel file named "UniqueIDTracker".

 

4. The problem here is, all of the ids collected are going to the UniqueIDTracker Excel form repeatedly so the new ID is not being filtered out. 

 

I am missing something here, and I'm not seeing it. Been trying to figure this out for a week now.Union1.JPGUnion2_LI.jpgUnion3.JPGUnion4.JPG

Highlighted

Hello @angelrodriguez ,

 

If I am getting this correct, You want to only add "New" items from the array to the excel table.

 

Okay so now that you have an array with unique values.

 

I have 2 ways you can do this: First way depends on if you want to change the column in your excel file to have no spaces. The Odata filter in excel limitations are, you cannot filter on spaces.

 

The second way is if you dont want to change the column name, We are able to filter using the filter array action

 

 

First Way:

 

pic1.png

 

pic2.png

 

 

 

 

Second Way:

pic3.png

 

pic4.png

 

 

I hope this has ultimately fixes your issue

 

—Josh
If you like my post please hit the "Thumbs Up" -- If my post solved your issue please "Mark as a Solution" to help others





Did I answer your question? Mark my post as a solution!

If you like my post please hit the Thumbs Up


Proud to be a Flownaut!


Check out my blog for Power Automate tips, tricks, and guides
FlowAltDelete




Highlighted

@angelrodriguez \ Please could you add me your excel files and your flow exported as zip to try to replicate your scenario? I'm sure I could help you.



Did I answer your question? Please consider to Mark
my post as a solution! to guide others :winking_face:

Proud to be a Flownaut!


If you want you can follow me at www.christianabata.com Quieres contenido en español? Síguenos en Power Automate LA
Highlighted

I tried the second way, I kept getting an error on the first. I'm guessing the last step, "If no" Add a row into a table I need to add the Current item to that. I'm still getting false in my Condition step before that so none of the unique ids are printing at the "If no" step. I'm hoping my Compose step is right, too. Yours lays out Union(variables('Array'), variables('Array')), but my only option is to grab the filter array step prior to Compose or Convert bucket to an array. Thanks.

Highlighted

All I want to do is capture the Task ID that does not repeat in the Task ID column.Union6.JPG

Highlighted

@angelrodriguez 

Post screenshot of error,

 

The flow is suppose to go to false if ID does not exist.

Hence why the add row is in there.

 

—Josh
If you like my post please hit the "Thumbs Up" -- If my post solved your issue please "Mark as a Solution" to help others

 





Did I answer your question? Mark my post as a solution!

If you like my post please hit the Thumbs Up


Proud to be a Flownaut!


Check out my blog for Power Automate tips, tricks, and guides
FlowAltDelete




Highlighted

It's not throwing an error, it's actually succeeding but the ID is going to exist at least once, but no more than once.

 

The array we're looking at will always show the new ID. I guess what I'm doing here is I'm comparing the same array to itself so the result will always be the same. I want to be able to filter out the unique ID like the one below 'aJYS_...' that only shows up once. This means that the Planner task was just added because on the last run, the task ID was not added because it didn't yet exist.

Union6.JPGUnion7.JPG 

Highlighted

Christian, how did you compare 'tiyulo' to 'value' without having to convert 'tiyulo' first?

 

I keep getting this error message about 'tiyulo':

InvalidTemplate. The execution of template action 'Filter_array' failed: The evaluation of 'query' action 'where' expression '@contains(item(), 1)' failed: 'The template language function 'contains' expects parameters of matching types: a dictionary and a key (string), an array and a value (object), or a string and a substring. The provided types 'Object' and 'Integer' are incompatible. Please see https://aka.ms/logicexpressions#contains for usage details.'.

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

Top Solution Authors
Top Kudoed Authors
Users online (10,674)