I am tasked with creating a custom document handling process in the power platform.
I have two document libraries, one is a "list" of documents required at each stage of a project(Lib A), the other is the document library holding the actual submitted documents(Lib B).
I need help turning this pseudo code into a PA Flow:
x = Length(get all items in Lib A where stage = current stage)
y = Length(get all items in Lib B where stage = current stage && document name = a document name in Lib A)
if y = x, move to next stage
Basically, I want a way to ignore all of the documents in Lib B that are not required IE do not have a matching Name/title in Lib A
In Lib B they can store any amount of documents, but I only want to count the required ones for the project. Right now my flow just counts everything in both.
Any help/advice is greatly appreciated!
Hi @CamCov ,
Could you please tell me what the data type of stage is?
I assume that the data type of stage is text.
If you want to filter that the document names in B are the same as those in A, you cannot directly compare the two objects, so you need to use join to convert A into string type and then match the document names in B.
I have made a test for your reference:
1.Set up LibA and LibB.
3.Get the LibB files and filter the files in which the stage is current stage.
5. Comparison length.
Thank you for the quick response!! Just to make sure we are on the same page:
Below you will see that the two required documents are PSF01 and PSF09. PSF01 has been submitted in lib b and PSF09 has not. Everything else submitted in Lib B is considered extra documentation at this point. So this would fail the condition check and not let you move to the next stage.
I want to ensure All documents in Lib A have a match in Lib B.
Your answer may be correct, but this picture threw me off as it looks as it checks all the contents of Lib A against only 1 item.
I could be incorrect here, but just want to make sure.
I see now a grave mistake I have made. My Project stage is a multiselect choice column because some documents are required at multiple stages
Hi @CamCov ,
Item is the function that when used inside a repeating action over an array, return the current item in the array during the action's current iteration. You can also get the values from that item's properties.
I think this link will help you a lot :
The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.
Announcing a new way to share your feedback with the Power Automate Team.
Learn to digitize and optimize business processes and connect all your applications to share data in real time.
Join Priya Kodukula and the licensing team, super users and MVPs to find answers to your questions on Power Automate licensing.