Table โProjectsโ have an enumlist column โInstallation Addressโ, that is ref to table โAddressesโ.
This enumlist column โInstallation Addressโ have suggested values (selection from table โAddressesโ):
SELECT(Addresses[Address ID], [Company ID] = [Buyer ID])
This enumlist column โInstallation Addressโ should have initial value (โthe latestโ address of the same selection in table โAddressesโ):
MAXROW(โAddressesโ, โ_ROWNUMBERโ, [Company ID] = [Buyer ID])
User may add a new item to the enumlist (by adding new address to the table โAddressesโ).
All three are working perfectly fine, separately. But when active all together, weird thing happening:
I also tried to use Valid If instead of Suggested Value:
IN([_THIS], SELECT(Addresses[Address ID], [Company ID] = [Buyer ID]))
But in this case user canโt add new address. Maybe thereโs a way to allow user new adds?
Thanks!
Solved! Go to Solution.
After ~8 hours wasted, it is solved. To all those, who want to save some time, dedicated.
The goal is:
All of these are working as supposed, except when user tries to add a new address. When the new address is entered and saved, it doesnโt appear in the enumlist. Although, the new address input is saved on the device, and will be saved on the Worksheet, if the record will be saved with any of the suggested addresses.
So, when user adds a new address it donโt appear in the enumlist, as it supposed to. My guess: the Initial Value triggers here and resets the enumlist to initial value (when only the latest address is selected).
The solution:
Instead of Initial Value MAXROW(โAddressesโ, โ_ROWNUMBERโ, [Company ID] = [Buyer ID])
I used this: [_THIS] + LIST(MAXROW(โAddressesโ, โ_ROWNUMBERโ, [Company ID] = [Buyer ID]))
This adds the initial value to the enumlist. The new address, entered by user, appears in the enumlist. But, in this case there will be duplicated. So, the final solution is:
UNIQUE([_THIS] + LIST(MAXROW(โAddressesโ, โ_ROWNUMBERโ, [Company ID] = [Buyer ID])))
This force the enumlist to work properly with all the above requirements together.
After ~8 hours wasted, it is solved. To all those, who want to save some time, dedicated.
The goal is:
All of these are working as supposed, except when user tries to add a new address. When the new address is entered and saved, it doesnโt appear in the enumlist. Although, the new address input is saved on the device, and will be saved on the Worksheet, if the record will be saved with any of the suggested addresses.
So, when user adds a new address it donโt appear in the enumlist, as it supposed to. My guess: the Initial Value triggers here and resets the enumlist to initial value (when only the latest address is selected).
The solution:
Instead of Initial Value MAXROW(โAddressesโ, โ_ROWNUMBERโ, [Company ID] = [Buyer ID])
I used this: [_THIS] + LIST(MAXROW(โAddressesโ, โ_ROWNUMBERโ, [Company ID] = [Buyer ID]))
This adds the initial value to the enumlist. The new address, entered by user, appears in the enumlist. But, in this case there will be duplicated. So, the final solution is:
UNIQUE([_THIS] + LIST(MAXROW(โAddressesโ, โ_ROWNUMBERโ, [Company ID] = [Buyer ID])))
This force the enumlist to work properly with all the above requirements together.
Very nice!
Small contribution to all, who struggling getting properly sorted List out of EnumList(Refs).
Instead of Dereference should be used multi-dereference, like this:
[EnumList_Tbl1][Referenced_Column_Tbl2]
(without a dot in between EnumList column and referenced column)
For reference:
User | Count |
---|---|
16 | |
10 | |
8 | |
5 | |
5 |