Print selected record with its childs

Yes, this is just ONE approach to reach out to the goal, and there should be another different approaches and workaround.

Take just an essence out of this sample and implement nice feature and function to your own app.

Let me know if you need more help on this topics.

2 Likes

Thanks @tsuji_koichi, just one doubt, following your sample app, would perfectly works if there are multiple users printing? Question, the app as it is, would it print what each user selected?

Yes, off course.

Each login user will not be bothered by other users.

Setting (in this case, selection) is always owned by the login users. You see useremail() expression in the print table, where we capture who made and save new form. And security setting for this table, we only read the row with email value which matches with login user.

1 Like

Hi @tsuji_koichi,

Thank you so much. Will test it soon.

@Geovany_Kelly has mentioned it works as per his requirement. Well done @tsuji_koichi

Thank you to @Aleksi and @Phil as well. Your insights are always practical and very guiding for us.

2 Likes

Gotcha! I just seen it. Alright, I don’t bother you more for now haha, I will test with my approach and let you know.

Thanks again, @tsuji_koichi

2 Likes

Please take your own time to look deep inside my sample app to see all the anatomy!!!
You will find it is not super complicated, just logical.

Enjoy my sample app haha.

2 Likes

I just threw a different spice to get different flavor :wink:

1 Like

Hi @tsuji_koichi,

I copied and browsed your app. Neat , clean implemenation indeed. Basically you separated printing selection into another table and then attached the selection status back to data source tables and then a clever use of slice of selected countries for the template. Very neat work indeed. :+1:

2 Likes

Correct.
You might read the descriptions I stated on the sample app page. Basically, we are missing sort of “state management” system within Appsheet. Meaning we are not able to store the particular data temporarily on the browser storage. For instance, the values of enumlist being selected by each users, we are not able to store those values in the app. That is the problem. To solve this, UserTable kinda of arrangement should solve, but on this particular case, I capture the values and store as a set of table, but we dont need the last values which need to be ruled out. Old selection of the countries in this case are kept saved in the table, but we wont use any longer, only need the most latest row and its value.

The trick is boiling down to a single expression within VC in country table like this.

IN(
[Country],
any
(
select(print[SelectedCountry],[TimeStamp]=max(select(print[TimeStamp],useremail()=[UserEmail])))

)
)

Simple expression isnt it?

To store the most latest “selected country values as list type”, just slice the table to get the single row with max, timestamp value etc.

Actually, we are not OVERWRITING this latest value all the time new form is generated. It could be possible we prepare the unique rows for printing table for each login users, and they keep refresh and updating the selection and then fire workflow, but my workaround should be better to do the same.

Actually we are able to use this tricks for another purpose and use case as well.

I m calling this trick as “Appsheet state management system” :wink:

Javascript liberary, angular, vue, react, they do have own state management system to develop single web page application (SPA), i just borrow such technique to implement into the Appsheet.

3 Likes

Hey @tsuji_koichi just a little bug I found, if possible make the update in your sample app, so developer don’t lose the mind as I did minutes ago haha.

Column “TimeStamp” from “Print” table change the column type from Time to DateTime, only that.

Let me explain why, since for now you are only saving the time and selecting the countries with the max TimeStamp, it would be issue if the same user print in the night, and maye print next day morning:

give it a look, the last print I submitted was at “0:58:47” but the formula returns the max time: “19:43:08”
image

after change and working like a charm:
image

1 Like

By the way the current report is working fine:

But how if I want data like this:

I am not getting any email none attachment. Am I doing something wrong?

Sorry, i forgot to change the data type to DateTime. I just updated my sample.

In terms of your mail template, I understand start end expression is only valid for list/table style only, but I m not entirely sure.

1 Like

Just worth trying.

What s gonna happen if you change the template like this?

image

Move start end expression outside table and sandwich the whole table?

3 Likes

I know it was something easy for you, that worked! Thanks @tsuji_koichi! :sunglasses:

1 Like

Wow! Great!

1 Like

@Suvrutt_Gurjar
@Geovany_Kelly

Hi Guys, I think there are quite useful tips we discussed and managed to get, which should be placed with “tips and tricks” flags so that people can find rather easily.

I will do that job later on, just simply create new threads and place link to this post.

3 Likes

When I go to that link I don’t see a Download a Copy or a look Under the Hood for that app. How can I access it? I think it will help solve a problem I have.

Thanks.