I have this Contracts app that is in use and has been flagged to me today with an issue.
When a new Contract is created/saved in the 'Register' SharePoint list, the 'Contract Ref' is automatically generated.
Below, "645" is the SharePoint item ID number.
At the same time, a Power Automate workflow runs and creates a folder in the 'Contracts' document library with the folder name being exactly the same as the item created in the 'Register' list (Contract Ref).
When documents are added using the '+' symbol in the "Contract Documents" panel, they are added into their unique folder in the 'Contracts' document library.
Some new items have been added this week and the documents are now showing in the 'Contract Documents' panel.
The filter expression I have on the 'Contract Documents' gallery is set to:
Filter(colContractFiles,'Folder path' = Concatenate("Contracts/",DataCardValue1.Text,"/"))
(where "DataCardValue1" is the 'Contract Ref' ID - eg. LWCM-01-04-2021-645)
All entires up to LWCM-10-11-2022-660 are showing the 'Contract Documents', however for LWCM-10-11-2022-661 and above, these are not showing anything.
For reference, the expression being used on the 'Contract Folder' is set to:
LookUp(colContractFiles, 'Full Path' = Concatenate("Contracts/" , DataCardValue1.Text))
and if required, the 'Default' value for 'Contract Ref' is set to:
If(IsBlank(Parent.Default) And varNewItem = true,Concatenate("LWCM","-",Text(DatePicker1.SelectedDate,"[$-en-GB]dd-mm-yyyy"),"-",Text(First(Sort(Register,ID,Descending)).ID + 1)),Parent.Default)
It would be good if someone could help me overcome this issue.
Solved! Go to Solution.
@sudosaurus There is option in Get Files called "Include Nested Items" switch it to Yes and try
What's the original Data Source of colContractFiles? This might be a case of exceeding the PowerApp limit. By default, Canvas app can retrieve only the First 500 rows of a data source and it can be extended up to 2000 in the settings.
What you can do is you need to apply delegation practices.
For example, when you navigate to a specific contract folder, you need to update the colContractFiles directly from the data source with the Filters. Below is the code given that your Parent SharePoint Document Folder is named contract.
ClearCollect(colContractFiles,Filter(contract,'Full Path' = Concatenate("Contracts/" , DataCardValue1.Text)))
Put whatever criteria you want to filter on in a Text field in the library metadata. The query is then delegable in any size Library You can even store 100K records.
Hope it helps
Collection is not really Delegable it's collecting based on ID from SharePoint and ID is partial delegable means You will have an issue to overcome 2000 limit in collection, but I saw some solutions to increase this.
I think this Video give You all hints what You need to amend Your code from Reza
I know you using collection for performance, but You may need ditch it and filter direct using metadata rather any id.
Hope it helps
Please put this before the contract screen loads.
Option A - On the control (maybe a button that you have set) that navigates to the Contract Screen
Option B - On the OnVisible property of the Contract Screen
Keep up to date with current events and community announcements in the Power Apps community.
A great place where you can stay up to date with community calls and interact with the speakers.
Check out the latest Community Blog from the community!