I was creating a birthday automated email. 2 sheets in online Excel. one with employee name and DOB, second with birthday quotes in each cells.
Flow created as to check today's date and DOB in excel. If matches, then pick a birthday quote from 2nd sheet of excel and send an email to the employee.
Now that sending email is working, but instead of sending one quote, flow sends all quotes in seperate email. Eg, if there are 30 quotes, flow sends 30 emails with each quote in each email.
my problem is it should pick only one random quote per match instance
Your welcome
Have a good one 🙂
That worked ! Thank you so much. understand when looping occurs, first to check 'apply to each' 😊
delete apply to each 2 part only do actions I send.
it sends email, picks only one sentence. But sends multiple emails with same details. I have 30 birthday quotes. It sends 30 emails. Earlier each mail had different quotes, now same quote sent 30 times
hi,
test your flow without parse Json get the outputs from compose action. copy and paste it
What could be the schema for parse Json
hi,
It seems like the problem is in your second apply to each. iin your way you are sending email for each birthday sentence.
I created an excel with this values,
and my flow is like this
what I do here is , list rows in excel is present in your flow.
You need to create a compose function like,
body('List_rows_present_in_a_table')?['value'][rand(1,length(body('List_rows_present_in_a_table')?['value']))]
It will give you an item in between your sentences.
and you need to get a parse json activity to only select the sentence.
Try test your flow, you will get an output from your compose copy and paste in your parse json generate from sample,
You will get a sentence variable you can put it in email.
If you need any further questions you can ask
Have a great one 🙂
Please find attached, flow.
Hi
add a step that selects a random quote from the second sheet.
Use a function or action that generates a random number , rand() within the range of the total number of quotes.Retrieve the quote corresponding to the randomly generated index.
If it is not working caan you show your flow?
WarrenBelz
146,660
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
66,004
Most Valuable Professional