Email Template Help

I'm stuck with making a script for my email template that will give me the results I'm wanting.

Here's my script so far:

<<Start: FILTER("Shipping Data Report", ISBLANK(FILTER("Shipping Data Report", AND(([_ROWNUMBER] < [_THISROW-1].[_ROWNUMBER]), ([PO Applied To] = [_THISROW-1].[PO Applied To])))))>>
<<[PO Applied To]>>:
<<Start: FILTER("Shipping Data Report", ISBLANK(FILTER("Shipping Data Report", AND(([_ROWNUMBER] < [_THISROW-1].[_ROWNUMBER]), ([PO Applied To] = [_THISROW-1].[PO Applied To]), ([SKU] = [_THISROW-1].[SKU])))))>>- <<[SKU]>> (<<COUNT(FILTER("Shipping Data Report", ([SKU] = [_THISROW-1].[SKU])))>>) <br><<End>> <<End>>

This gives me the following result:

13384:
- 4392-Avanti Black-No Legs (25)
- 3942-Victory Lane Chocolate-200P (16)
- 3941-Victory Lane Chocolate-200P (14)
- SC3-3723-Vernon Black-5 Pack (1)
- 3723-Victory Lane Dolphin-No Legs (2)
- 3721N-Victory Lane Dolphin-No Legs (2)
- 3721N-Vernon Walnut-200P (25)
- 3723-Vernon Walnut-200P (25)
- 4393-Hayden Grey-No Legs (6)
- 4444-Vernon Bark-No Legs (1)
- 4443-Vernon Bark-No Legs (1)

13421:
- 4392-Avanti Black-No Legs (25)
- 3942-Victory Lane Chocolate-200P (16)
- 3941-Victory Lane Chocolate-200P (14)
- SC3-3723-Vernon Black-5 Pack (1)
- 3723-Victory Lane Dolphin-No Legs (2)
- 3721N-Victory Lane Dolphin-No Legs (2)
- 3721N-Vernon Walnut-200P (25)
- 3723-Vernon Walnut-200P (25)
- 4393-Hayden Grey-No Legs (6)
- 4444-Vernon Bark-No Legs (1)
- 4443-Vernon Bark-No Legs (1)

What I'm trying to accomplish is to have a PO number listed (PO Applied To) then the related items (SKU) listed below it with a total count for each item for that PO. As you can see above, I'm definitely not getting what I wanted. I did try searching for this which has helped me get this far, but I'm lost. Help!

0 1 45
1 REPLY 1


@RobBehymer wrote:

As you can see above, I'm definitely not getting what I wanted


Actually, we have no clue what the expected result should be.  It looks to me like you are getting a value that could be a SKU and then a count in parenthesis.  So its seems to match with waht you said.  What is wrong with the results?

It would be helpful to describe how your automation is setup.  Is this a Scheduled Bot and are you using the "ForEachRowInTable" property?

Second, a description of your Data Tables and relationships would be good as well.

***********

I wonder if the [_THISROW-1] usage is doing what you think it's doing.  It is a reserved keyword that allows you to reference UP and ancestor tree - Parent, Grandparent, Great Grandparent, etc.  So, as an example, [_THISROW-1].[Name] is equivalent to [_THISROW].[Parent].[Name].  For more details you read this article,

https://support.google.com/appsheet/answer/11541779?hl=en#:~:text=%3D%3E%20Top%20level-,%5B_THISROW%...

Top Labels in this Space