Let's assume that I have a table Row ID, Start year, End Year and Year. If User enter Row ID - 1, Start year - 2017, End Year - 2020
then my flow should add rows like in the picture. Any help here would be really great!
Datasource: SQL server. Need to run this flow in Power Apps.
Solved! Go to Solution.
@Anonymous I realized I forgot to increment the variable in the sample I shared with you! Apologies. That would explain why you are getting 200+ rows. You need to increment the 'Year' variable inside the Do-Until loop.
The reason I started the 'Year' variable with 'Start Year'+1 is because I thought the input row from your example was already in the table. Is that true?
Hi Gopi,
Do-until loops are used to repeat a step until a condition is met. From your photo it looks like you are adding a row to the SQL table for each year that will pass between the start year and the end year, inclusive.
In this case, you can initialize a variable 'Year' with ('Start Year' + 1), and add a row until 'Year' equals the 'End Year'. Here's my example. I declared 'Start Year' and 'End Year' as variables, but you'll use the dynamic content from the SQL inserted row trigger.
Please see the images. I have created flow like your example but it is adding only one line. Am I missing anything here?
'Initializevariable_Value' = Start Date (SOP SQL column name) + 1
'Insertrow_Year' = End Date (EOP SQL column name)
Flow
SQL Output
Hi @Anonymous
Drag and drop your 'Insert Row' action inside 'Do until'
Best Regards,
Gustavo Moraes
Gustavo Moraes, o astronauta brasileiro do Flow!
I am not sure why! It is running more 200+ rows and all the Year field as Start Date +1.
Is there any video tutorial to help me here?
If I use Start Date + 1 inside flow itself then it is throwing error.
@Anonymous I realized I forgot to increment the variable in the sample I shared with you! Apologies. That would explain why you are getting 200+ rows. You need to increment the 'Year' variable inside the Do-Until loop.
The reason I started the 'Year' variable with 'Start Year'+1 is because I thought the input row from your example was already in the table. Is that true?
It's working now! Thank you so much!
The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.
Learn to digitize and optimize business processes and connect all your applications to share data in real time.
User | Count |
---|---|
12 | |
9 | |
7 | |
7 | |
7 |
User | Count |
---|---|
19 | |
18 | |
17 | |
10 | |
7 |