Scheduled Bot Template: Data Grouping Issue

Hello,

Iโ€™ve configured a scheduled bot as shown in the attached image and applied a formula in the template. My expectation was for the data to be grouped by supplier, but it didnโ€™t work as intended. Do you have any suggestions on what might be wrong? Thank you

BotBotTemplateTemplateErrorError

Solved Solved
0 4 188
1 ACCEPTED SOLUTION

Steve
Platinum 5
Platinum 5

You're using a scheduled event to generate the PDF. The event is attached to a table, not to a specific row in the table. In your template, you refer to _THISROW, which is intended to refer to a specific row. Because the event is not attached to a specific row, there is no row to which _THISROW can refer.

This:

Steve_0-1730470367973.png

should instead be this:

<<Start: ORDERBY(SELECT(purchase_order[id], AND(([_THISROW].[supplier] = [supplier]), ISNOTBLANK([date_raised]), ISBLANK([due_date]), ISBLANK(SELECT(purchase_order[id], AND(([_THISROW].[supplier] = [supplier]), ISNOTBLANK([date_raised]), ISBLANK([due_date], ([_THISROW].[_RowNumber] < [_RowNumber]))))))), [supplier].[company_name])>>

This expression produces a list of id values from the purchase_order table for only the first occurrence of each matching supplier value. This gives you your list of suppliers.

Then, this:

Steve_1-1730470718560.png

should instead be:

<<Start: ORDERBY(SELECT(purchase_order[id], AND(([_THISROW-1].[supplier] = [supplier]), ISNOTBLANK([date_raised]), ISBLANK([due_date]))), [client].[brand_name])>><<[client].[brand_name]>>

This expression gets you the purchase orders associated with the specific supplier.

View solution in original post

4 REPLIES 4

Actually, the pdf generator from appsheet was not stable in some cases, that's why i prefer an appscript generator for that.

To solve your case try creating a virtual columns to each of your input variables, create the formula there and then make all the type value as Text. 

ALWAYS enter a value to the PDF generator as TEXT Type.

Nothing about your reply is valid here.

Steve
Platinum 5
Platinum 5

You're using a scheduled event to generate the PDF. The event is attached to a table, not to a specific row in the table. In your template, you refer to _THISROW, which is intended to refer to a specific row. Because the event is not attached to a specific row, there is no row to which _THISROW can refer.

This:

Steve_0-1730470367973.png

should instead be this:

<<Start: ORDERBY(SELECT(purchase_order[id], AND(([_THISROW].[supplier] = [supplier]), ISNOTBLANK([date_raised]), ISBLANK([due_date]), ISBLANK(SELECT(purchase_order[id], AND(([_THISROW].[supplier] = [supplier]), ISNOTBLANK([date_raised]), ISBLANK([due_date], ([_THISROW].[_RowNumber] < [_RowNumber]))))))), [supplier].[company_name])>>

This expression produces a list of id values from the purchase_order table for only the first occurrence of each matching supplier value. This gives you your list of suppliers.

Then, this:

Steve_1-1730470718560.png

should instead be:

<<Start: ORDERBY(SELECT(purchase_order[id], AND(([_THISROW-1].[supplier] = [supplier]), ISNOTBLANK([date_raised]), ISBLANK([due_date]))), [client].[brand_name])>><<[client].[brand_name]>>

This expression gets you the purchase orders associated with the specific supplier.

Top Labels in this Space