Evening all,
A collection lookup has randomly stopped working today.
The collection is a local version of a sharepoint list, filtered by whichever department the current user is a part of. It holds academic unit names, and their codes. When the user selects a unit from a dropdown, the unit code should be automatically populated in the list, but as you can see below, there is nothing appearing:
The code for the lookup is:
LookUp(ahUnits,'UE - Dd - Unit Name'.Selected.Unit_x0020_Title=Unit_x0020_Title,Unit_x0020_Code)
I can see that the collection is there, and populated. The fields I need are all there with the correct name, but it just randomly has stopped working.
The collection is gathered on appStart.
As a test, I circumvented the collection and pointed the lookup directly at the SharePoint list, and that works fine. It just seems to be the lookup against the collection. I have also tried storing the list in a global variable as well, but still nothing.
Any help?
I discovered the problem.
The collection itself was working, but the use of the Proper function was stripping out the Title from the rest of the record. Sort and Filter work fine, and return the whole record for me to get my Unit Code from, the code of which I took from @Drrickryp's suggestion. Removing Proper, and instead formatting the base data in the lookup worked.
Thank you for your response!
Unfortunately, it comes up with a "Name isn't valid" error when i try to get the unit code. I think it's because my dropdown (which is a combobox) is filtered, sorted and put into a Proper text format:
Sort(Proper(Filter(ahUnits,Department = currentDept).Unit_x0020_Title),Unit_x0020_Title)
I can only assume I have essentially stripped the record of anything other than the unit title. Any idea how to get around this?
Hi @EpicTriffid ,
Please note that the action of app.onstart only perform when the app starts running.
It will not run again when you play the app.
I suggest you populate the collection again by setting the drop down's OnChange, which will update collection every time you select section in the drop down.
I also suggest you check whether there's one record meet the condition.
You could use this to check:
If(!IsEmpty(Filter(ahUnits,'UE - Dd - Unit Name'.Selected.Unit_x0020_Title=Unit_x0020_Title),true,false)
If the result is true ,then there's record meeting the condition.
If the result is false, then there's no record meeting the condition.
Best regards,
Hi @EpicTriffid
If you are using lookup for the textinputbox to show the code for the selected Item in the dropdown, I think you are overthinking the problem. A dropdown holds an entire record but only shows one field in the window. However, you can reference every field in the record shown in the dropdown simply by setting the Default field of the TextInput box to reference the field other than the one displayed in the dropdown as follows:
Dropdown1.Selected.MMUid
Likewise you could use a label control to show the same data by setting the Text property to the above.