I have a form where I'm wanting to show a list of available vendors based on an expense type selected. The form is associated with an Expenses table, in the table there are multiple rows with expenses, and the Expenses table includes the Expense Type (Enum, base type Text) and Vendor (Enum, base type Text). When the user selects the Expense Type on the form, I'm wanting the list of available vendors to be displayed for the Vendors to show all vendors associated with the Expense Type selected, but also allow a new vendor to be added if it's not in the list. My Suggested Values has the following:
SELECT(Expenses[Vendor], TEXT([Expense Type]) = TEXT([_THISROW].[Expense Type]),TRUE)
This returns the vendors associated with the selected Expense Type on the form, but after it displays the associated vendors, it then shows all vendors in the Expense table.
When I include the following in the Valid If, it works the way I'm expecting but it's not allowing the user to add a new vendor:
IN( [_THIS], SELECT(Expenses[Vendor], [_THISROW].[Expense Type] = [Expense Type]))
What am I missing or doing wrong? Thanks in advance!
Solved! Go to Solution.
References my friend... too many people aren't doing references in their apps.
#ReferencesAreEssential
On your Expense Types table (when looking at an Expense Type record in your app) you'll now see all the [Related Vendors] for that Expense Type.
Anytime you need that list of Vendors (for say a dropdown) you can simply dereference that list.
[Expense Type].[Related Vendors]
User | Count |
---|---|
17 | |
11 | |
6 | |
5 | |
5 |