Incorrect Error Given Workflow template

Hi! I have this formula:

If([Include _'s Store Visits?]=โ€Noโ€,Start: Orderby(Select(Previous Years Report[Key],And([Company]=โ€Gonnella",Contains([_ThisRow].[Store Lists To Include In Report],[List]))),[Today]),โ€โ€)

This formula is in a workflow template. However, I get an error message on AppSheet telling me:

Workflow rule โ€˜Previous Year Reportโ€™ action โ€˜Previous Yearโ€™s Reportโ€™ Body template. Expression โ€˜Orderby(Select(Previous Years Report[Key],And([Company]=โ€Gonnella",Contains([_ThisRow].[Store Lists To Include In Report],[List]))),[Today]),โ€โ€)โ€™ is invalid due to: Expression โ€˜Orderby(Select(Previous Years Report[Key],And([Company]=โ€Gonnella",Contains([_ThisRow].[Store Lists To Include In Report],[List]))),[Today]),โ€โ€)โ€™ could not be parsed due to exception: Number of opened and closed parentheses does not matchโ€ฆMORE INFO

This error is incorrect, however, as I have 5 โ€œ(โ€ and 5 โ€œ)โ€, and they are placed in the correct positions, I beleive. Would anybody be able to help me fix this issue? Thanks!

0 8 525
8 REPLIES 8

maybe look at your โ€œโ€""

Hi @retailpartnercom,

If you look at the error thrown by editor, the parser is not taking the part of expression before Orderby

The error message starts with Orderby rather than If([Include _'s Store Visits?]=โ€Noโ€, Start:, in your expression. This shows that the expression part before Start: that is **If([Include _'s Store Visits?]=โ€Noโ€ Start: ** is treated as a separate expression. As a result, the terminating part of your expression ,[Today]),โ€โ€) which is actually result part of IF expression is treated inside the Orderby(โ€ฆ expression while evaluating but its starting part **If([Include _'s Store Visits?]=โ€Noโ€, Start: **is outside the expression. So you are getting one extra bracket and error.

I believe you will neeed to close your Start: expression at appropriate place with an << End >> and even before start you need << such as <<Start:

The above suggestion is only related to syntactical error thrown by the parser.

Hope this helps

Hi @Suvrutt_Gurjar! I tried placing a โ€œ<<โ€ before my start, and an extra โ€œ>>โ€ at the end, but it didnโ€™t work. I should place the <> after everything on the page, right? I already have that. Thanks a lot!

Hi @retailpartnercom,

Thank you. My response was in general related to why you are seeing syntactical error for mismatch in parentheses.

I believe for properly formatting your expression, you may also wish to take a look at the very informative article below , just in case you have not. The artilce also describes using IF and Start: statements in templates.

Hope this helps.

Hello @Suvrutt_Gurjar! The article only helps a little bit. My parenthesis still match, but now it is still not working. HERE is the document. Is there anything wrong with my document? I looked for all parenthesis with cmmd + F, and )/( matched in #. I also colored the parenthesis to make sure they matched, and they still did. Any advice? Thanks!

It might be easier for me to just create 8 workflows instead of 4, to separate the ifs into their own document, so it works without all this pain. I appreciate the advice and your time! Thanks! @Suvrutt_Gurjar

Steve
Platinum 4
Platinum 4

The fundamental problem is the occurrence of Start: in your expression. It should be removed.

Also:

  1. [Include _'s Store Visits?]=โ€Noโ€ is better written as NOT([Include _'s Store Visits?]).

  2. Select(Previous Years Report[Key], ...) is better written as FILTER("Previous Years Report", ...).

  3. [Company]=โ€Gonnella" is better written as โ€Gonnella"=[Company] to avoid unexpected results because of the quirky behavior of the = operator.

  4. Contains([_ThisRow].[Store Lists To Include In Report],[List]) may not work as intended. The second argument should be a single value, but [List] would appear to be a list. CONTAINS() is not designed to compare lists.

Read more:



Thanks!

Top Labels in this Space