Reference to make an inline table without using key

I was trying to get an inline reference in my invoice table from my table that have the last 6 approved invoices by vendor. The Key in my invoice table is ProcessID and the key in my last 6 invoice is ProcessID but I want to match them based on vendor not ProcessID and the reference column only seems to work with the key of the table.

0 6 282
6 REPLIES 6

Bahbus
New Member

Ref columns must have Key values in it, otherwise it won’t actually link. That being said, however, we can still do what you want with the Key values. However, I’ll need some more information on how your table is constructed. Can you send screenshots of the spreadsheet for those two tables so we can get a quick understanding of how your structure is working?


This is the Invoice Header table. Textract_Process_ID is the Key and Label in appsheet as well.
The other table, LastSixInvoices is identical as it is a view of this table but it is: Group By ‘Vendor_ID’, Limit 6, Where Approval_Status=Approved. So I want an inline view of the LastSixInvoices linked by Vendor_ID not Textract_Process_ID

@Austin_Lambeth
If I have understood you correctly, you want an inline view in your Vendor_Detail View to show the invoices that belong to that particular Vendor. If so:
1.) In your Vendor Table, create a VC with below expression:

SELECT(
	Invoice Header[Textract_Process_ID],
	AND(
		[Vendor ID]=[_THISROW].[Vendor ID],
		[Approval_Status]="Approved"
	)
)

@Austin_Lambeth
If you only want to show the last 6 invoices, you can try with this instead:

TOP(
	ORDERBY(
		SELECT(
			Invoice Header[Textract_Process_ID],
			AND(
				[Vendor ID]=[_THISROW].[Vendor ID],
				[Approval_Status]="Approved"
			)
		),
		[Invoice_Process_Date],
		FALSE
	),
	6
)

Not in the Vendor_Details sorry. In the Invoice_Header table. The goal is to have an inline view in my Invoice Header view that shows the last 6 approved invoices so the user can compared if the current invoice is outside of the normal margins of the last 6. We already have the last 6 invoices done in database as the view LastSixInvoices.

@Austin_Lambeth
You can use the same expression just with changing the tablename I assume

TOP(
	ORDERBY(
		SELECT(
			Invoice Header[Textract_Process_ID],
			[Approval_Status]="Approved"
		),
		[Invoice_Process_Date],
		FALSE
	),
	6
)
Top Labels in this Space