Hi everyone,
This is a requirement that is not common but is needed for one of project. The thing is we all know on how to do search on records in a sharepoint list. But now what I want to do is that provide a option to 'Add items' which is like:
So as you can see in the above picture in the first pop-up: Displaying a screen (pop-up) where user gets a option to add a folder and inside that folder we can place multiple files
And then a search option is provided which will perform a global search which will display all the results based on search option (we can do a search based on tags associated with the file or show all files based on the search input) like:
like the MS 365 search provided. So for now I am just want to search based on the tags associated with the file (the tags can be uploaded after uploading the files).
Please let me know on how to implement the above scenario in Canvas App.
Regards,
Sidhant.
Hi @Sidhant_02 ,
If your doubts have been cleared, can zou please press "Accept as Solution" button on the post(s) that was(/were) key to answering your questions so they will be easier to find for other members of the community?
Thank you @BCBuizer ,
Thanks for clearing my doubt and the response really appreciate that.
Thanks & Regards,
Sidhant.
Hi @Sidhant_02 ,
Folders are also considered items, so that's why the Distinct formula returns a blank as well: Folder items don't have a tag. To fix this use the Choices function instead which should return all possible values for the Tag column as set in SharePoint:
Choices(ListTag.Tag)
As for the question regarding displaying the folder name, I assume you wish to show the name of the folder where an item resides. To get that you'll still have to use the folder path column, but you can apply some string manipulation to extract only the folder name:
Last(
Split(
Replace(
ThisItem.'Folder path',
Len(ThisItem.'Folder path'),
1,
""
),
"/"
)
).Value
So I have added a drop-down and a gallery control.
For drop-down I have used the 'Distinct' keyword to get unique values from the List (have created another list for test purpose named ListTag) but in the drop-down it displays a blank value (which should not)
And currently to display the folder name I am using the folder path, but is there a way to just display the name of the folder instead of path
Regards,
Sidhant.
Hi @BCBuizer ,
Okay will check this out. There is a slight change in the requirement currently I was using a multi-line of text to store the tags but now
1. Instead of using the text column I have to use a choice column (there will be some choices) and on the search item I need to show the folder name. Searching will be done based on the value selected in drop-down (we were using Text previously) now have to use dropdown.
like:
PowerApps folder:
t1.txt tag: security
Search: security
Search result should be : Powerapps- t1.txt - security
(Format: Folder_name - File name - Tag_name)
Regards,
Sidhant.
Hi @Sidhant_02,
The formula I provided is for a 1:N relationship, but what you describe is for a N:N relationship.
What you have to do to make this delegable:
- Change the Tags column to a single line of text.
- Only record a single tag per item
- Use multiple Text input controls, 1 per tag(, or consider using drop down controls)
Change your formula to:
ClearCollect(
SearchResults,
Filter(
TagsList, //My SharePoint list
Tags = Lower(Trim(txtSearchText1.Text)) ||
Tags = Lower(Trim(txtSearchText2.Text)) ||
Tags = Lower(Trim(txtSearchText3.Text)) ||
Tags = Lower(Trim(txtSearchText4.Text)) ||
Tags = Lower(Trim(txtSearchText5.Text))
)
)
In this formula you have 5 text input controls and a result will be returned if an item matches the value entered in one of them.
Still the ClearCollect function is not delegable, but at least first the filter is applied before, hopefully limiting the number of returned items to below the Data Row Limit.
And similarly if I tried to search for a record with multiple tags like
It does not return any match:
Thanks @BCBuizer ,
For sharing. So as you have mentioned the following expression is not delegable is there any way to make it delegable so in the future there is no problem even if the records keep on increasing.
On using the expression that you have mentioned on the search button it is not displaying any error but on the formula it does:
So just corrected the spelling but now I am facing the same issue it is only returning one result i.e. in both my folders (PowerApps,Mendix) there is a record with the tag: 'email'
In PowerApps it returns only the record from Power Apps but I expected it to return E1 and Email
Regards,
Sidhant.
Hi @Sidhant_02 ,
I think these are the correct syntaxis to achieve what you want:
ClearCollect(
SearchResults,
Filter(
TagsList, //My SharePoint list
Tags in ForAll(
Split(Lower(txtSearchTags.Text), ","),
Trim(ThisRecrod.Value)
)
)
)
Please take into account his is very far away from being delegable, so once you hit 2000 items in your data source, this solution will stop working.
So currently what I have done is I have created a collection (SearchResults) to store the serachpoint records, my sharepoint list looks like this:
I have created the Tags column which is a multi-line column. In case of searching records with one tag I am able to do it but if a file has more than one tag then there is an issue, like
As you can see above I searched for email so I was expecting two search results E1 from Power Apps and Email from Mendix folder but it just returned the record from Power Apps folder. So for that I tried using this:
ClearCollect(
SearchResults,
Filter(
TagsList, //My SharePoint list
Or(
ForAll(
Split(Lower(txtSearchTags.Text), ","), // Spliting records
CountIf(Tags, Tags = Trim(Result)) > 0
)
)
)
)
But highlighted that the Or function has some invalid arguments and instead of Table expected a boolean. So I am stuck over here now. If anyone has any idea how to resolve this do share your suggestion.
Regards,
Sidhant.
WarrenBelz
791
Most Valuable Professional
MS.Ragavendar
410
mmbr1606
275
Super User 2025 Season 1