Hello everyone,
I have made a flow that it is getting a HTML file from SharePoint Library it's updating some data (stored in a excel file also uploaded in SharePoint Library) and update the HTML file.
Files used:
HTML file:
Excel file for data updating:
As i was saying - the flow picks that label made in HTML and updates %code1,2,3,4,5% with info from excel file.
The flow is working perfectly !
Note*: Excel table contains 2 rows !
Now comes my question:
What needs to be done so this flow will iterate through the excel table and create as many labels as rows number in the excel table ? In my table, there are 2 rows, but at this moment the flow is picking only the first one.
Thank you in advance for your support !
Solved by creating a monster of a expression 😅 :
Result:
Thank you @annajhaveri for replaying !
I have changed the 'Apply to each' and adjust it properly (I think).
Now the flow is making to many duplicates of the label. As far as I can see, it is making a duplicate for each 'Compose' and its making one change per each label (%code1% in first label, %code2% in second label, %code3% in 3rd label and so on).
Result: (I put only 3 examples but the flow its making 10)
I even changed the flow and leave only one 'Compose' with all the replacement
Replacement expressions:
replace(variables('LabelCode'), '%code1%', items('InitializeReplacements')?['ITEM_CODE'])
replace(variables('LabelCode'), '%code2%', items('InitializeReplacements')?['CUSTOMER_ITEM_CODE'])
replace(variables('LabelCode'), '%code3%', body('Convert_time_zone'))
replace(variables('LabelCode'), '%code4%', items('InitializeReplacements')?['QTY'])
replace(variables('LabelCode'), '%code5%', items('InitializeReplacements')?['ITEM_CODE_DESCRIPTION'])
What am I doing wrong ?
Since I have 2 rows on my excel table I want the label to be duplicated two times and fill all %codes% with data from excel.
@Anonymous i see that you have apply to each actions to loop through excel rows, but the compose action used inside apply to each action will retain the value of only one row, if you want value of all rows, then you need to define array variable in start of flow and then use Append to array variable inside the apply to each action.
WarrenBelz
146,587
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
65,928
Most Valuable Professional