How to access dinamic values on the go

If the app is running, and the user has a list of elements in the parent view. When he selects one element of the list, the app logically delivers de user to a child view (with the details of the selection made in the parent view).

At this point, how can the code access the value selected by the user? Is there any variable like USEREMAIL() to acces the โ€œUSERSELECTEDโ€ option dinamically?

I hope I could express correctly what I need to know.

Thanks!

0 3 203
3 REPLIES 3

Steve
Platinum 4
Platinum 4

Iโ€™m guessing youโ€™re using a dashboard view, and that the dashboard view has interactive mode enabled. You want to know which deck/gallery/table view the user clicked on to display the corresponding detail view. Correct? There is no way to programmatically get the row the use clicked on; but if youโ€™re willing to explain what you want to accomplish, we might be able to offer alternatives.

I will try to explain what I want to accomplish, but first I will explain what I have so far:

First, the user has a Card view that points to a google sheet called โ€œDATOS GENโ€. This google sheet contains a table with all the apartments of a residential condo with the following columns:

  • [UNIDAD] Is the apartment number (column key and label)
  • [NOMBRE] The name of the owner of each apartment.
  • [EMAIL] The GOOGLE email address of the owner. This column is compared with USEREMAIL() in order to show only the apartments that this particular user owns.
  • [MAX CANT INVITADOS] is the max quantity of guest allowed for each apartment.
  • [Related INVITADOS] is a virtual column (list) that is referred from other google sheet called โ€œINVITADOSโ€ in order to show a list of the names of guests corresponding to that apartment (the source is the table INVITADOS).

the table INVITADOS contains a list of all the guests of all the apartments with the following columns:
[UNIDAD] The apartment number of the guest (this is NOT a key column, because its values can be repeated in the table)
[EMAIL PROPIETARIO] this is the GOOGLE email of the owner.
[NOMBRE INVITADO] the name of the guest
and thereโ€™s more irrelevant data columnsโ€ฆ
The Key column is the โ€œ_RowNumberโ€ column in this table. (Not recommended by appsheets, it warns it)

Now,

Lets say, for instance, a user owns 2 apartments. He will see 2 cards, each one with the corresponding apartment.

When the user clicks a card. The app shows a child view with the details of that unit with all the data from the selected row coming from โ€œDATOS GENโ€, plus an embedded list of allowed guests from column [Related INVITADOS] that shows the filtered data of allowed guest for that apartment.

This list has an โ€œaddโ€ link in orde to add guests to that apartment, and when the list reaches de max quantity of guest allowed for that apartment ([MAX CANT INVITADOS]), the add link disabled (or no longer swown) as expected.

I did it by adding the following formula to the โ€œAre updates allowed?โ€ setting of table INVITADOS in appsheets:

IF(COUNT(SELECT(INVITADOS[UNIDAD],[UNIDAD]=โ€œ103Bโ€))<INDEX(SELECT(DATOS GEN[CANT MAX INVITADOS], [UNIDAD]=โ€œ103Bโ€),1),โ€œALL_CHANGESโ€,โ€œUPDATES_AND_DELETESโ€)

where โ€œ103Bโ€ is the number of an apartment for testing purposes.

The problem is that it works only for apartment โ€œ103Bโ€ because I donโ€™t have access to the apartment the user selected in the parent view.

And thatโ€™s what I want to accomplish: To restrict the number of guests depending on the value [CANT MAX INVITADOS] of the selected apartment.

I hope this summary of my app allow you to hepl me find the solution. Iโ€™m new to appsheetsโ€ฆ

Thank you!

Any Ideas?

Top Labels in this Space