Hi all,
I am using this formula in a Flow.
PowerAutomate does not show a failure during creating the flow but in runtime it says that sub should have 2 parameters but has 3.
div(sub(ticks(utcNow('yyyy-MM-dd')),ticks(formatDateTime(variables('nextTermin'),'yyyy-MM-dd')),864000000000))
My question:
Is there a way to copy the formular to Visual Studio Code (or a different editor) so that I can have Syntax Highlighting to investigate the error? Must have something to do with parantheses I think...
(Edit: of course I know how to copy the formula 😉 My problem is: how to save so that syntax highlighting is active? What language to choose or is there an addon for Visual Studio Code?)
Thank you!
div(
sub(
ticks(
utcNow('yyyy-MM-dd')
),
ticks(
formatDateTime(
variables('nextTermin'),
'yyyy-MM-dd'
)
),
864000000000
)
)
Ah! That´s great!
Thank you! 👍👌
Awesome!! Well done! 🙂
I open a "Plain Text" and put the cursor near the parenthesis. VS Code will do it for you.
Here's my VS Code configuration.
Please don't forget to mark "Accept as Solution" so that other people here can benefit from it.
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.
Cheers
Manuel
Thank you!
You helped me very much with the parenthesis - it worked!
But can you tell me how do you use Visual Studio Code so that the parenthesis are highlighted correctly?
If I paste it there the text is just white.
VS Code can help a little in your problem, highlighting the parenthesis and where they correspond. As you can see, there are 3 parameters on the sub.
Regarding your issue, indeed, there's an issue with the parenthesis. You can validate it:
Not what you want. Here's the correct sequence.
Can you please check if and let me know if you have any questions?
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.
Cheers
Manuel
Michael E. Gernaey
566
Super User 2025 Season 1
David_MA
516
Super User 2025 Season 1
stampcoin
492