Hi all,
Hello, so I´m stuck, basically, I created a form with different class options, but every class just has 3 seats so the first 3 people who answer the form get the seat, I don't know how to define the variable in power automate to automatically decrease the number every time a person registers into a class.
I am getting error message in "Action 'Compose' failed"
Error Details
Unable to process template language expressions in action 'Compose' inputs at line '0' and column '0': 'The template language function 'length' expects one parameter: an array or a string the length of which is returned. The function was invoked with '0' parameters. Please see https://aka.ms/logicexpressions#length for usage details.'.
This is the form used
And this is the SharePoint site used
Thank you very much for your help in resolving the issue. I really appreciate it, and now the flow is running perfectly!
Thanks for all the answers. The error is fixed now. But the logic is wrong for to restrict the booking for each class to a maximum of 3 participants and fail any additional booking attempts when the class is already full.
The error itself is straight forward. You didn't share the code, but simply put, you are putting a blank or non-array value in the length expression.
Also, adding a variable into Power Automate as a counter will not work.
What you really need to do is write these to SharePoint or somewhere, based on their incoming Time, so that you can easily sort them and figure out who the Top 3 are.
Since these can fire near simultaneously,, trying to figure out who is the to 3 within the context of the flows themselves, really isn't ideal.
Just capture them all that come in and you can easily tell who wins the 3 seats based on when they come in.
If I have helped you, I would really appreciate if you please Mark my answer as Resolved/Answered, and give it a thumbs up, so it can help others
Cheers
Thank You
Michael Gernaey MCT | MCSE | MCP | Self-Contractor| Ex-Microsoft
https://gernaeysoftware.com
LinkedIn: https://www.linkedin.com/in/michaelgernaey
Michael E. Gernaey
566
Super User 2025 Season 1
David_MA
516
Super User 2025 Season 1
stampcoin
492