cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
FIVESIGN
Frequent Visitor

Search & Filter Managed Metadata

Hey dear Community members!

I just can't get any further, and everything I find on the net doesn't work or confuses me even more. What I want to do should actually be quite simple and yet I am losing my mind!

I have a SharePoint list and in one column we write tags that match the topic - this is a Managed Metadata column.

Currently I have a gallery that is searched with the following code.

 

SortByColumns(Search(Filter('MY LIST'; !'Toggle'.Checked || ('Toggle'.Checked && 'Flow Variable' = "Approved") ); searchbox.Value; "Title"); "Title"; Ascending)

 


This works perfectly. Now I want to search not only via title, but also in the tags (Managed Metadata). But it just doesn't work and I figure it out. I thought I could just bring in the "tags" as a search value as well, but that doesn't work.

SortByColumns(Search(Filter('MY LIST'; !'Toggle'.Checked || ('Toggle'.Checked && 'Flow Variable' = "Approved") ); searchbox.Value; "Title" & "Tags"); "Title"; Ascending)


Then I tried differently and created a combobox, but here I just get the values 0 - 19 and not the available tags.

Sort(Choices('MY LIST'.Tags); Value; Ascending)


Any ideas?

1 ACCEPTED SOLUTION

Accepted Solutions
v-albai-msft
Community Support
Community Support

Hi @FIVESIGN ,

This is because Managed Metadata column shown as a text, but indeed its data type still is managed metadata.

So, if the Managed Metadata column does not allow multiple values(with single value), you can simply save this MMC column value into a new column using AddColumns function. See my example, my managed1 column is a MMC column that does not allow multiple values, so I use this formula:

Search(AddColumns(list6,"Newmanaged1",managed1.Label),TextInput1.Text,"Newmanaged1")

v-albai-msft_0-1617951480380.png

v-albai-msft_1-1617951480383.png

 

If the Managed Metadata column allows multiple values, you should concatenate multiple values to a string using Concat function. See my example, my managed2 column is a MMC column that allows multiple values, so I use this formula:

Search(AddColumns(list6,"Newmanaged2",Concat(managed2,Label&";")),TextInput1.Text,"Newmanaged2")

v-albai-msft_2-1617951480385.png

 

So on your side, you should try this(single value):

SortByColumns(Search(
Addcolumns(Filter('MY LIST'; !'Toggle'.Checked || ('Toggle'.Checked && 'Flow Variable' = "Approved")),"NewTags",Tags.Label); searchbox.Value; "Title","NewTags");
"Title"; Ascending)

Or(multiple values):

SortByColumns(Search(
Addcolumns(Filter('MY LIST'; !'Toggle'.Checked || ('Toggle'.Checked && 'Flow Variable' = "Approved")),"NewTags", Concat(Tags;Label&";")); searchbox.Value; "Title","NewTags");
"Title"; Ascending)

Best regards,

Allen

View solution in original post

11 REPLIES 11
v-albai-msft
Community Support
Community Support

Hi @FIVESIGN ,

This is because Managed Metadata column shown as a text, but indeed its data type still is managed metadata.

So, if the Managed Metadata column does not allow multiple values(with single value), you can simply save this MMC column value into a new column using AddColumns function. See my example, my managed1 column is a MMC column that does not allow multiple values, so I use this formula:

Search(AddColumns(list6,"Newmanaged1",managed1.Label),TextInput1.Text,"Newmanaged1")

v-albai-msft_0-1617951480380.png

v-albai-msft_1-1617951480383.png

 

If the Managed Metadata column allows multiple values, you should concatenate multiple values to a string using Concat function. See my example, my managed2 column is a MMC column that allows multiple values, so I use this formula:

Search(AddColumns(list6,"Newmanaged2",Concat(managed2,Label&";")),TextInput1.Text,"Newmanaged2")

v-albai-msft_2-1617951480385.png

 

So on your side, you should try this(single value):

SortByColumns(Search(
Addcolumns(Filter('MY LIST'; !'Toggle'.Checked || ('Toggle'.Checked && 'Flow Variable' = "Approved")),"NewTags",Tags.Label); searchbox.Value; "Title","NewTags");
"Title"; Ascending)

Or(multiple values):

SortByColumns(Search(
Addcolumns(Filter('MY LIST'; !'Toggle'.Checked || ('Toggle'.Checked && 'Flow Variable' = "Approved")),"NewTags", Concat(Tags;Label&";")); searchbox.Value; "Title","NewTags");
"Title"; Ascending)

Best regards,

Allen

View solution in original post

Hi @FIVESIGN ,

How are things going? Is my reply helpful to your issue?

Best regards,

Allen

Thank you very much for your support, and sorry for the late reply. I was on vacation. Worked perfectly and you were able to explain it very understandably - very helpful for me as a complete beginner.

Really appreciate it! Wish you a good week!

Can you perhaps also give me a tip on how to create a search with available suggestions instead of just a search - a sort of dropbox. I can't manage it, always get only a numbering from 0 to 19.

Hi @FIVESIGN ,

Sorry I cannot understand your new question, could you explain more?

Best regards,

Allen

Hey @v-albai-msft, sorry, English is not my strong point. I will try again. 😊

We have a list of different suppliers and they are additionally tagged with what these suppliers offer. Ideally, users of the app would have the ability to see what tags are available. I imagine a kind of dropdown where they can then click on the available tags.

I have tried this, but I don't see a dropdown in the menu. Tried it with a combo box but there just comes a dropdown with numbers 0 to 19 without the content.

Here I use the code:

Choices(MYLIST.METADATACOLUMN)

 

Conclusion: I want a combination of search and dropdown - but I can't do it.

FIVESIGN_1-1618829482103.png

Could I explain it more understandable? Thank you very much for your time and support! I really appreciate it very much.

 

This is my menu in Teams PowerApps:

FIVESIGN_0-1618829437446.png

Hi @FIVESIGN ,

Do you want to create a dropdown with all Managed metadata tags and also make this dropdown searchable?

Or do you want to create a dropdown with all selected Managed metadata tags in your list?

 

From your formula, I think you want to achieve the first purpose.

If yes, you can add a combo box control, set its Items property to Choices(MYLIST.METADATACOLUMN).Label, also set its SearchFields property to [“Label”]:

v-albai-msft_0-1619167931628.png

 

v-albai-msft_1-1619167931631.png

If I misunderstand, you can give me some examples to explain your purpose. Example like this:

My managed metedata column called "managed2", I want to create a dropdown and display all selected tags in my dropdown(with 4 tags in my example picture):

v-albai-msft_2-1619167997189.png

Best regards,

Allen

 

Thank you Allen @v-albai-msft  but unfortunately something is missing. If I add the combobox, then I can set the property for "Items" but I do not have the property "SearchFields". These are the choices I have when I go to the combo box properties:
 
 Screenshot 2021-04-23 141747.pngScreenshot 2021-04-23 141800.png
There is no "SearchField"
 
My goal is this. I have a list of suppliers and in one column the area of expertise of these suppliers is entered and this is done via the Metadata column. Now I want to show in a dropdown only those tags that were also entered in the list. Here is an excerpt from the list. All tags that appear here should be selectable in the dropdown.

 

Screenshot 2021-04-23 141824.png

 
I am infinitely grateful for your support!

Hi @FIVESIGN ,

1. Can you see this SearchField property in the right property panel?

v-albai-msft_0-1619422397855.png

 

If still no, you can try to remove this combo box and re-add it, check if you can find the "SearchField" property.

 

2. I know you want to show 12 options in your combo box("AR" option is duplicated). You can try this:

In the OnStart property of your app, set this(list6 is my SP list name, replace to your list name):

ClearCollect(test1,AddColumns(list6,"Tags2",Left( Concat(Tags,Label&","), Len( Concat(Tags,Label&",") ) - 1 )).Tags2);
ClearCollect(test2,Split(Concat(test1, Tags2, ","), ","))

Then set the Items property of your combo box to(remove duplicate and blank options):

Filter(Distinct(test2,Result),!IsBlank(Result))

Check result this time.

Best regards,

Allen 

Hi @v-albai-msft I don't see a property named SearchFields. I have created a GIF for you, with the hope you see something.


powerapps_community.gif

Thank you Allen!

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (2,012)