cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
sudosaurus
Post Prodigy
Post Prodigy

Delegation issue showing files in document library

Hello,

 

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.

 

sudosaurus_0-1669206226060.png

 

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.

 

Thanks,

Chris

1 ACCEPTED SOLUTION

Accepted Solutions

@sudosaurus There is option in Get Files called "Include Nested Items" switch it to Yes and try


If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users to find it.

View solution in original post

24 REPLIES 24
cha_cha
Resident Rockstar
Resident Rockstar

Hello @sudosaurus 

 

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.

 


 
Just in case you my answer helped you solve your problem, please mark/accept this as a SOLUTION This helps community members if they experience a similar issue in the future.

 
bistek.space   @cha_bistek    @BisTekSpace 
sudosaurus
Post Prodigy
Post Prodigy

@cha_cha 

 

The data source is the the “contracts” document library.

 

what do we do after 2000 has been exceeded?

cha_cha
Resident Rockstar
Resident Rockstar

Hello @sudosaurus 

 

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)))

 


 
Just in case you my answer helped you solve your problem, please mark/accept this as a SOLUTION This helps community members if they experience a similar issue in the future.

 
bistek.space   @cha_bistek    @BisTekSpace 

Hi @sudosaurus 

 

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


If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users to find it.
SebS
Memorable Member
Memorable Member

@sudosaurus , @cha_cha 

 

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.

 


If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users to find it.
sudosaurus
Post Prodigy
Post Prodigy

Any pointers on what expression to use?

@sudosaurus 

 

I think this Video give You all hints what You need to amend Your code from Reza

 

Power Apps SharePoint Document Library Tutorial - YouTube

 

I know you using collection for performance, but You may need ditch it and filter direct using metadata rather any id.

 

Hope it helps


If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users to find it.

@cha_cha I get this error when using that expression:

sudosaurus_0-1669244065184.png

 

cha_cha
Resident Rockstar
Resident Rockstar

Hello,

 

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

 

cha_cha_0-1669245290194.png

 


 
Just in case you my answer helped you solve your problem, please mark/accept this as a SOLUTION This helps community members if they experience a similar issue in the future.

 
bistek.space   @cha_bistek    @BisTekSpace 

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (6,059)