web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Syntax Highlighting in...
Power Automate
Answered

Syntax Highlighting in formula

(0) ShareShare
ReportReport
Posted on by

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!

Categories:
I have the same question (0)
  • manuelstgomes Profile Picture
    6,625 on at

    Hi @der_cosmicyes 

     

    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.

    Screenshot_2021-02-01_at_09_04_52.jpg

     

    Regarding your issue, indeed, there's an issue with the parenthesis. You can validate it:

    Screenshot_2021-02-01_at_09_04_45.jpg

     

    Not what you want. Here's the correct sequence.

    Screenshot_2021-02-01_at_09_06_06.jpg

     

    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

  • RK-23070616-0 Profile Picture
    on at

    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.

  • Verified answer
    manuelstgomes Profile Picture
    6,625 on at

    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.

    Screenshot_2021-02-01_at_10_59_23.jpg

     

     

    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

  • RK-23070616-0 Profile Picture
    on at

    Ah! That´s great!
    Thank you! 👍👌

  • smadep Profile Picture
    96 on at
    I found this VS Code extension
    still a bit buggy, but it helps
     
  • Chriddle Profile Picture
    8,441 Super User 2025 Season 2 on at
    I always write expressions with line breaks and indentations.
    This way I can immediately see what is going wrong.
     
    E.g.
    div(
    	sub(
    		ticks(
    			utcNow('yyyy-MM-dd')
    		),
    		ticks(
    			formatDateTime(
    				variables('nextTermin'),
    				'yyyy-MM-dd'
    			)
    		),
    		864000000000
    	)
    )
     
  • smadep Profile Picture
    96 on at
    @Chriddle, still looks nicer that way ;-)
    but of course - indentation for the rescue - that's best practice anyway for "more complex" expressions
     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 501 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 323 Moderator

#3
abm abm Profile Picture

abm abm 237 Most Valuable Professional

Last 30 days Overall leaderboard