
Announcements
Hello, hoping for a little assistance,
I am creating a birthday announcement automation for my organization. I'm using a dataverse connector to get contact info from D365, OneDrive to write to an Excel file for testing, and email, to test sending the message. I am trying to store a list of birthday quotes in an array, and then pick a random item from that list later in a for each loop and use it in a email/excel. The trouble that I am having is that when I attempt to select a random item and store it in a variable, it appears that the variable is blank.
Here's what I have:
I declare the array variable and set the value.
I declare the variable to hold the selection being picked from the array, (leaving it blank so I can set its value next). (ignore the comment, that was from a previous try)
Within my for each loop, I attempt to set the variable with this expression
When I test the flow, the variable varCurrentQuote appears to be empty.
Any help would be appreciated, thanks!
-ER
I think you mixed the tutorial you were following. The body and how that was for a SharePoint action of Get Item.
Since because you are using an array variable to store your birthday quotes try using this expression
variables('varBdayQuotes')[rand(0,length(variables('varBdayQuotes')))]
Please click Accept as Solution if it resolved your problem or give it a Thumbs Up if it helped you in anyway this will allow other people to search correct solutions effectively.
Thanks,
Rahber