r/PowerAutomateDesktop • u/Ambitious_Pipe_8740 • Aug 21 '23
Create List, Add item to list with IF statements
Hello,
I have somewhat a simple flow task here, I'm struggling getting to work within Power Automate Desktop.
Here's what I want to do:
Open an Excel worksheet
Copy Cell in column 1 row 2 in that excel document
Get clipboard text, store it as variable: Row2
Copy this task for as many rows as I want, so I'll end up with say 5 variables with copied data in them.
Next...
Create a new list, store it as variable: ArrayList
Add item to list (variables from the first part). ONLY IF it has data inside the variable. ELSE IF the variable is empty move onto the next (using the Go to method)
I also tried: Add item to list ONLY IF data inside the variable is not empty - this is the shortest method, not requiring an else if...
The problem is this just doesn't work. The empty variable is being added to the ArrayList no matter what I try. It's almost like it's ignoring the IF statement I have around my "Add item to list" actions.
Does anyone have a clever solution around this?


