Hi, I am trying to use a lookup activity to build a SQL query to retrieve some data UNIONing multiple tables.
Input: [{"Table":"Accounts"},{"Table":"Users"}]
Output in expression builder:
SELECT * FROM [Accounts]
UNION
SELECT * FROM [Users]
P.S: I understand there is an iterate activity to use, and it helps iterate through multiple tables and fire single query per tables within array and essentially combined the output from each activity to create a combined output, but that is very costly.
Edit: The expression should stay the same as it would handle different length of array and it is able to union all the tables based on the how many input is given