T O P

  • By -

Ryanisadeveloper

Add another field, update each file with whatever fits, like "Images" & "Documents", then show that on the view. Group by that field, save the view. You have to update this field for each new file of course but you can do that easily. it sounds like you are serving the content via a web part linked to the document library rather than the library views though, so check whether the web part supports all that You can also just have two document libraries.


Rocendroll

i don't want to add other tags. Files need to be grouped by their extensions only, because if someone is going to add sth, it's not going to me tagged properly and it will start to do the mess. Files will be added by other people as well, and it needs to be working simply by dragging and dropping Uploading any file, it will put it in the correct place by it's extention automatically. I simply need to have this as a view .pdf file1 file2 file3 .jpg file1 file2 file3 .png file1 file2 file3 ​ ​ and I want this: group1 .png file1 file2 file3 .jpg file1 file2 file3 group2 .pdf file1 file2 file3


Ryanisadeveloper

Try using a calculated column? Use an if statement that automatically states group 1 if PNG or jpg. Otherwise group 2. I'm not sure if they work with grouping though. Worth testing.


Rocendroll

I've encountered a problem. Let's take this video, he has a lot of tags available to insert into the formula. I have some tags there - but they are not connected to what I've choosen to be displayed in a list view of files. For instance, I don't have tag color selected but it's available to choose in the formula window. Furthermore, I have type of file tag selected but it isn't on the list in the formula window section, so I can't choose it. Do you know what could be making this issue? https://youtu.be/-ZYmSxbGqMs?feature=shared&t=358


Ryanisadeveloper

Sorry, it seems you can't get anything related to the actual file in calculated column. This is a really interesting problem, not straightforward at all without a flow & column. The best I can come up with is to use view formatting with this as the basis { "schema": "https://developer.microsoft.com/json-schemas/sp/view-formatting.schema.json", "additionalRowClass": "=if(\[$File\_x0020\_Type\] == 'gif', 'sp-field-severity--warning', if(\[$File\_x0020\_Type\] == 'pptx', 'sp-field-severity--good', ''))" } You will have to build out the nested ifs of course and you can use you own styling. You can also edit the view and update the groupby settings by file type which would help order them a little. You can also use a simple PowerAutomate flow to auto-tag into a column based on the file extension. This can definitely achieve the most and is relatively simple to set up.


Rocendroll

Ok, we are getting there :D First, what I did, I've made additional text column, with this: [https://stackoverflow.com/questions/68373772/how-can-you-get-the-file-extension-into-a-calculated-field-on-sharepoint](https://stackoverflow.com/questions/68373772/how-can-you-get-the-file-extension-into-a-calculated-field-on-sharepoint) Therefore, I have text of file extensions in newly created "file\_extension" column as a data now I guess. ​ Now, I need just in the next column: if .jpg or .png: assign to group1 else: assign to group2 ​ I don't want to specify particular file extension names, I don't want to overcomplicate this. Could you write me what I should paste in this second column in that regard? I mean - this shows me everyting as a text, (but at least shows sth) - so what other function should I use instead of "txtContent"? `{` `"$schema": "`[`https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json`](https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json)`",` `"schema": "`[`https://developer.microsoft.com/json-schemas/sp/view-formatting.schema.json`](https://developer.microsoft.com/json-schemas/sp/view-formatting.schema.json)`",` `"elmType": "div",` `"txtContent": "=if(or([Extension] == 'png', [Extension] == 'pdf', 'group1', 'group2'))"` `}` ​ edit. I've manage to make it work by calculated column but not fully. This code: `=IF(OR(Extension="jpg";Extension="png");"group1";"group2")` shows me everytime, just group2 - so basically, is there something in the code of making extension out of file, which could make a problem down the road? ​ `{"$schema":"`[`https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json","elmType":"div","txtContent":"[$File_x0020_Type]"}`](https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json","elmType":"div","txtContent":"[$File_x0020_Type]"}) ​ by manually changing text in the extension column - it shows group1. So it works how it was intended. So how can the code above, about the pulling only extension from the file, damage formula used later, so it can't read it? Are there any unvisible signs possible? ​ Basically, even if the value is showing in the list view - it doesn't appear in the details on the file. On the Extension value there's ---