I'm trying to setup a very simply bot that will post a message to our Slack server once a day.
This bot should read a random row from an Excel file, and post the contents of this row to Slack.
I managed to find this tutorial online, which seems to be exactly what I need, but it's vague for someone with little to no experience with Power Automate, such as myself: https://blog.johanpersson.nu/?p=4086
Essentially, what I'm stuck on is initiating the RAND variable. This article simply list the formula as:
rand(0,int(length(body(‘ListRows’)?[‘value’])))
But this on it's own, doesn't work, so clearly I'm supposed to substitute some information here with dynamic content, but I'm not sure what. It seems that no matter what combination of information I put into the Value for my Initialize Variable, results in:
InvalidTemplate. Unable to process template language expressions in action 'Initialize_variable' inputs at line '0' and column '0': 'The template language function 'int' was invoked with a parameter that is not valid. The value cannot be converted to the target type.'.
The only Dynamic Content I have to pick from, are the following:
- Body (List of Items)
- Value (List of Items)
- body/value - items
- %My Table Header%
I don't understand what any of this dynamic content is, or how to correctly use this information to correctly get my RAND function, to start at 0 and run to the "Length of my table".
Hoping someone can give me the ELI5 breakdown here to understand what is going on here.