I have this column in a sharepoint file library called "Department_List". This has a bunch of values that look like this separated by a comma.
["1.1.1 New Department"],["2.2.2 New 2 Department"], ["3.3.3 New 3 Department"],etc.
What happens is the flow is kicked off from a Delete Department in Powerapps. That then runs and removes the department from a separate Department SharePoint List but I also need it to go into the Document Library, see if that Department Title is in that 'department_list' column, remove it while leaving the other values there.
Click trash icon in Powerapps for department 2.2.2 New 2 Department, workflow kicks off, it goes into my other Department SharePoint List, deletes it from there, then need to hop over to the 'smc doc library' search for that same 'title' in the "department_list" column and remove it but still keep the other values.
I hope that explained it.
Hello @Km00 ,
I'd probably use the 'Filter array' action for this. Get all the current values in the column, and then in 'Filter array' filter only those that are not equal to the dynamic content (the deleted value). That will create an array with only the remaining values and you can update them back.
this variable has all the column items in it for that item, but i need to remove the one we previously deleted with, i have a variable for as well called 'varDepartmentDeletedTitle. Find row that has 50. asdfsadfsadf in it, remove that, put everything else back together.
Ive tried and failed on everything.
I just need to know how to filter a array and remove 1 value from it and then update the array without that 1 value so i can update sharepoint.
i ended up creating a variable call varArray. I split the array so it looks like this:
i then need to filter varArray to remove a text that i put into a different variable: varDepartmentDeletedTitle. the varDepartmentDeletedTitle is a string as it is just a single line of text.
if you can see from the screen shot for example, i just deleted 8.1 System Waste Reduction from my Department List, so now i need to remove it from this array and re-update the sharepoint list with the new array minus the deleted department. Can anyone help with this?
Hello @Km00 ,
looking at the department variable, you should get the value without the HTML tags first. Use the 'HTML to text' action for that. The output of that action will be only the value, e.g.
50. asdfasdfa
Once you have the value, I'd format it in the same way as all the other values in the array, that means adding the [\" before the value and \"] at the end.
concat('[\"', OutputFromHTMLtoText, '\"]')
That should give you the value in the same format as in the array.
[\"50. asdfasdfa\"]
Now you can use the 'Filter array' to filter from the array only the items where item() is not equal to the value. NOTE: the format of the values might be different in your use case, just make sure that the values in the array have the same format as the value you're trying to remove.
User | Count |
---|---|
89 | |
37 | |
26 | |
13 | |
12 |
User | Count |
---|---|
128 | |
53 | |
38 | |
26 | |
21 |