Get column value from navigated view

B4R_2023.jpg

I'm building an app for matching donations with receivers. I have 2 database tables. When looking at donor details (Table 1), I show potential matches from receivers (Table 2) for whom the donation would be suitable, based on some filters. The user can click on one of the potential matches and see details about the potential receiver.

If the user thinks that it is a suitable match, we'd then send an email to the possible receiver informing that we've found a match. For this I've created an email action in Table 2. However, I'd like to include some details about the donation from Table 1 (such as the Unique ID and product dimension). I'm unable to do that because the Email action in Table 2 doesn't know which donor from Table 1 we are referring to.

Is there some way for the Table 2 detail view to know which record from Table 1 it was opened from, and then refer to the Unique ID column for that record in Table 1, so that it could be included in the email? I'd also want to be able to update other columns in Table 1 (eg. to reserve the donation for the receiver to whom we've sent the email)

All help appreciated, as I'm quite new to using AppSheet. Thanks.

โ€ƒ

0 5 272
5 REPLIES 5

Is there not a reference between the 2 tables?

https://help.appsheet.com/en/articles/1090811-dereference-expressions

The 'Possible Matches' is a virtual list column in table 1 with element type 'ref', and a filter in the app formula.  It filters a list of records from Table 2 (in this case, 'Tommi' and 'Dima').

How should I write an expression for an action in Table 2 (in this case, 'Dima'), that would be able to pick up the unique ID from Table 1 (in this case, 'A4') using dereferencing? I want to assign the donated product to one of the possible receivers. There are multiple possible receivers at this stage for any donated product.

So you do not have a Ref column in Table2 pointing to Table1? The [Possible Matches] uses a FILTER, and not a REF_ROWS?

You need to find some way to associate the Table1 record, with the chosen Table2 record. Not really sure what makes most sense for your app here. Can a Table2 record be a possible match for more than one Table1 record?

You could also maybe just temporarily flag the Table1 record, like by setting NOW() to a column, then you can look the record up with MAXROW().

Thanks for your reply. Correct, [Possible Matches] uses a filter instead of ref_rows.

A donation can match with multiple potential receivers. Similarly, a receiver can match with multiple possible donations. So yes, a Table 2 record can match with multiple Table1 records. The user browses through different donations, looks at the generated 'possible matches', and then decides which receiver to assign the donation to. I'd like an action button on the Table2 (receiver) view which would link the chosen receiver to the donation, and I'm stuck there.

For me to set any value to Table1 record (such as NOW() ), I probably need to know which Table1 record the user is interacting with. When they tap on a 'possible match' list item, I lose the context between the Table1 record (the donation) and the now opened Table2 record (the receiver). Even though they are visible side by side on the screen (as in my screenshot above), I'm not able to pull the Unique ID from Table1 to Table2 automatically.

For me to set any value to Table1 record (such as NOW() ), I probably need to know which Table1 record the user is interacting with.


The user would have to manually click one button on the Table1 record to flag it, then a second button on the desired Table2 record to initiate the further action, which could then look up the appropriate Table1 record with MAXROW()

 

Top Labels in this Space