The flow trigger is Recurrence based on the specific schedule.
<fetch>
<entity name="lzw_application">
<attribute name="lzw_applicationid" />
<filter>
<condition attribute="statuscode" operator="eq" value="859130000" />
</filter>
<link-entity name="sharepointdocumentlocation" from="regardingobjectid" to="lzw_applicationid" alias="DL4">
<attribute name="relativeurl" />
<link-entity name="sharepointdocumentlocation" from="sharepointdocumentlocationid" to="parentsiteorlocation" link-type="outer" alias="DL3">
<attribute name="relativeurl" />
<link-entity name="sharepointdocumentlocation" from="sharepointdocumentlocationid" to="parentsiteorlocation" link-type="outer" alias="DL2">
<attribute name="relativeurl" />
<link-entity name="sharepointdocumentlocation" from="sharepointdocumentlocationid" to="parentsiteorlocation" link-type="outer" alias="DL1">
<attribute name="relativeurl" />
<link-entity name="sharepointsite" from="sharepointsiteid" to="parentsiteorlocation" link-type="outer" alias="SPS">
<attribute name="absoluteurl" />
</link-entity>
</link-entity>
</link-entity>
</link-entity>
</link-entity>
</entity>
</fetch>
For each Application retrieved from the previous List Rows, list the Document Location folder to see if the folder contains the specific folder (in the next step). List folder action from SharePoint connector requires two parameters. The Site Address can be populated with the absoluteurl value of the SPS alias (SharePoint site) from the result.
@{items('Apply_to_each_Document_Location_of_Application')?['SPS.absoluteurl']}
encodeUriComponent(concat('/', items('Apply_to_each_Document_Location_of_Application')?['DL1.relativeurl'], '/', items('Apply_to_each_Document_Location_of_Application')?['DL2.relativeurl'], '/', items('Apply_to_each_Document_Location_of_Application')?['DL3.relativeurl'], '/', items('Apply_to_each_Document_Location_of_Application')?['DL4.relativeurl']))
From the output of the List folder action, filter the item where the Name is “Approval Letters”. After that, the flow will only process only the Document Locations which has the “Approval Letters” folder by checking the number of items from the output of the filter step.
length(body('Filter_array_for_Approval_Letters_folder'))
The step is quite similar to the one in step 2. The only difference is the ‘/Approval Letters’ at the end of the folder path to query all documents under the “Approval Letters” subfolder. Then, the files can be processed or sent in the subsequent step.
encodeUriComponent(concat('/', items('Apply_to_each_Document_Location_of_Application')?['DL1.relativeurl'], '/', items('Apply_to_each_Document_Location_of_Application')?['DL2.relativeurl'], '/', items('Apply_to_each_Document_Location_of_Application')?['DL3.relativeurl'], '/', items('Apply_to_each_Document_Location_of_Application')?['DL4.relativeurl'], '/Approval Letters'))
Original Post http://linnzawwin.blogspot.com/2022/02/find-sharepoint-folder-with-particular.html