I am trying to build a Power Automate flow that gets store list and item list (from a metadata excel file) for each manager, create a file (copy of a template), and write the values into this newly created file.
Below is my current flow.
The metadata file has two tables (assignment and item list).
So, first it'll get the assignment table
Then, select only managers column
And get a list of unique managers (this is Compose step using union: union(body('Select_Managers'),body('Select_Managers'))
it will also get the item list.
It will loop through each Manager.
- It will filter the list of stores that is assigned to the manager (Filter array).
- It will Get the region that the manager's stores belong to. (Compose)
- It will filter the list of items for the manager (Filter array)
-Get file content of template file
My template looks like this: It has two sheets. Sheet1 has two tables. A1 to C2 is HeaderTable, and D5 to P27 is ItemCount table
Metadata sheet has one table: Metadata table
-after getting the template file, it will Create file for the manager, using dynamic file name like this: formatDateTime(utcNow(), 'yyyy-MM-dd')_item_count_items('Apply_to_each').xlsx
File Content is body('Get_file_content')
So far, it works. it is able to create files using the dynamic file name and it copies the template file.
I am now trying to write into the HeaderTable. So, I added Update a row, selected Site Address and Folder Path, and put outputs('Create_file')?['body/Id'] in File. As I don't have thie file or table yet, I manually typed in "HeaderTable" into Table.
I typed Row_ID into Key_Column and 1 into Key Value. I don't know what to put in "Provide the item properties". I want to add formatDateTime(utcNow(), 'yyyy-MM-dd') into cell B2 and the name of the manager, which is items('Apply_to_each'), into cell C2.
What is the best way to do this? I don't exactly understand what item properties mean.
I am very new to power automate. can someone help me? Thank you!