Print selected record with its childs

Hi team,

This is what I looking for: Select the Countries and print the related info of each one:
image

I was trying to follow this great topic by @Suvrutt_Gurjar

I have table “Countries” with fields:

  • Country (key column)
  • Image
  • SendReport
  • Related Overview (virtual column)

And table “Overview” with fields

  • Country (key column and related with “Country” table)
  • Care
  • Country of origin
  • Language

I have this action to fire the workflow:

this is the workflow:

  • target data: Countries
  • Update event: UPDATES_ONLY
  • If this is true => Condition:
    • AND(ISNOTBLANK([_THISROW_AFTER].[SendReport]),
      [_THISROW_BEFORE].[SendReport] <> [_THISROW_AFTER].[SendReport]
      )

This is my gDoc template:

And these are my issues:

  • the Header of my template is not repeating for next pages.
  • I am getting an email with its attachment per selected Country
  • The attached show me all the list of Countries of the table (not the only ones I selected), and repeating the data of Country where I fired the action:

As I told I was trying to follow the topic mentioned above, but if any of you have a better idea to get what I am needing, I will appreciate, many thanks in advance, guys!

Headers are not supported see topic “Page Headers, Page Footers, and Page Numbering are Not Supported” in this article https://help.appsheet.com/en/articles/2993197-google-docs-email-templates

3 Likes

@Geovany_Kelly ,

Could you mention ,if the action that you have shown in the first picture in your post where user selects the records for printing or for the report is “Send Report” action that you have described in detail later?

1 Like

Correct, is the same, thar action updates the column “SendReport” from the Countries table.

1 Like

Hi @Geovany_Kelly ,

Thank you. So are you getting 3 reports emails for example , if you select three records?

I believe your group by logic is overall working but since your selection of rows is not reaching the template exression, because your action is “Send Report” and not “Select Rows” ,you are seeing all the countries in your report.

Also I believe you need two additional actions to select/ deselct the recrods for the report, may be with a new column called, say [Selected in Report] in Overview table with enum statuses Yes/No, You may then set this column with two complementary actions ( say “Select in Report” and “Remove from Report” that show up and act alternatively. So through this action “Select in Report”, you may set the column [Selected in Report] to “Yes” and with action “Remove from Report”, you may set the column [Selected in Report] to “No”

Now in the ourter loop you may have an expression something like

<<Start: SELECT(Overview[Country], [Selected in Report]=“Yes”)>>

Then you may fire “Send Report” action from any one row in the country records.

This process may be further optimized but I believe you get an idea.I hope this helps.

2 Likes

Hi @Suvrutt_Gurjar,

I added the new column “Selected in Report” (Yes/No), just for testing I am manually editing it from the app and value is set to “TRUE” in the gSheet.

But I am still getting 1 email with its report per Country that has TRUE in the “Selected in Report” column. And still getting all the list of Countries, not only the ones with TRUE in the “Selected in Report” column.

I changed the condition of the workflow to send the email but not sure if I am doing something wrong here:

and this is the template with your suggestion:

thanks in advance for taking time helping.

You should still use the same condition rule than earlier like AND(ISNOTBLANK([SendReport]),[_THISROW_BEFORE].[SendReport]<>[_THISROW_AFTER].[SendReport]). At this moment your Workflow is triggered every time when you set the [Selected in Report] as TRUE.

3 Likes

Hi @Geovany_Kelly

As rightly guided by @Aleksi, your condition for firing report should be same as earlier.

The additional column suggested is just for selecting the records per your choice.

1 Like

I set it back with that formula, is still sending me all the list of countries, and as always repeating the info of the Country that has value in the “SendReport” column:
image

right now I did this test: I selected Belgium, Bolivia (Belgium already has value in SendReport column) but I clicked the action “Send report” from record “Brazil”
image

and the report comes empty. I suppose it’s because Brazil has empty the “Selected in report” column.

Hi @Geovany_Kelly,

Your selected in report column is showing TRUE in the database.
SoI believe you are using a Y/N type column that stores TRUE for Y and FALSE for N in the database.

however it looks like your template expression is still

<<Start: SELECT(Overview[Country], [Selected in Report]=“Y”)>>

Could you please try with
<<Start: SELECT(Overview[Country], [Selected in Report]=TRUE)>>

Hi @Suvrutt_Gurjar,

it’s correct, those are the values and column type. I just tried that expression
<<Start: SELECT(Overview[Country], [Selected in Report]=TRUE)>>

and testing with only 1 country, but still getting the attached file with all countries, not for the specific one. I am not sure what I am missing.

you have to consider the completely different approach to achieve your goal, I guess.

1 Like

Hi @tsuji_koichi,

That’s for sure. I just don’t have many experience with reports and actions, not sure if maybe someone in the community can create a simple sample app with this case would be better.

Sure, i just read and access to the thread you opened up here, my impression was you cant achieve your goals by doing what you are trying to do with Appsheet, so I suggested to consider to have a different approach.

Nothing is impossible with Appsheet. But the danger is to stick with one approach, while we may have other approach to end up with the same result.

Yes, this is complicated and challenging subject, but that s why it is interesting.

Appsheet surely can manage to deal with your unique requirement, I believe, for sure, but to see the same thing, sometime we need to see the same from the different approach and/or angles.

We may sacrifice one thing during the new process, but as far as we are able to achieve the goal, it should not be a matter.

2 Likes

Hi @tsuji_koichi,

Thank you for your valuable inputs. As always, I respect your evaluation and inputs.

Hi @Geovany_Kelly,

Since I participated in this post thread , requesting you to do certain steps, I feel obliged to work more on this requirement. I will be glad to work with you further on this to the best of my ability. I propose following

I will go through this entire post thread again and try to revert with some approach, if feasible and within my capacity. I may have more queries to you during this time. Also since this thread has become substantially long , we may take it offline through mesaging service of this portal and post approach , if found, later for reference here. We may request community experts’ guidance, if required, in between.

Of course,as @Phil has guided, please note that we will not be working on pagination, headers, footers etc.

I am sorry that I need to call it a day as it is late night at my place. However, I will be willing to work on this tomorrow. Request let me know your thoughts.

3 Likes

I will revert tomorrow as well nigh nigh.

3 Likes

Thank you @tsuji_koichi- that will be great.

Thanks all for replying, and both @Suvrutt_Gurjar, @tsuji_koichi

really appreciate for taking time to help on this. That kind of attitude has been key to make AppSheet a great platform to develop Apps.

I will continue testing and pending of any comments to get this solved. Thanks again, guys.

1 Like

I just quickly created a sample app to share my idea to set up Apps to manage

  1. Select the name of countries (enumlist)
  2. Fire the email workflow to generate the tables / list of “selected” countries alone together with each child records associated with each country.

The approach is different from one which have been discussed earlier on this thread, but let the user to select the country through the FORM (rather than select ones over the Deck view and trigger the bulk actions), and then saving form will fire the workflow to submit email with attachment to the log in user.

This is little complicated tricks, so please copy my sample app and look inside.

Sample app is right here.

https://www.appsheet.com/samples/Sample-App?appGuidString=bd70d37c-ccc1-4ce0-899f-6f735d4035f0

here is sample for sample PDF which is generated by this sample app.

@Geovany_Kelly
@Suvrutt_Gurjar
@Phil
@Aleksi

5 Likes

Hey @tsuji_koichi!

That was brilliant! Definitely that is a solution for this topic using another approach!

You know, I will try to take some of your app logic to adapt it to my original approach, I will try to use the same action when selecting, then when click the action button will add the countries to a new table “Print” and finally trigger the email when ADD_ONLY for that “Print” table. I will try and keep you posted.

Again, thank you so much guys!
@Suvrutt_Gurjar Many, many thanks!
@Phil
@Aleksi

1 Like