Power Automate – add more data to a CSV log file

  • Post category:Flow
  • Post comments:2 Comments

This Power Automate workflow adds data to the same CSV file after each run. The most common use case is saving results of the workflow to a CSV log file. Of course, it would be a bit more complicated than my test scenario but the concept is exactly the same. Pros of the workflow: puts the most recent data at the top of the CSV file; saves data into a single file rather than multiple (although each approach can have its use case); the latter makes it much easier to search through. The initial file can be empty (just the headers) or have some matching data: 1) Initialize variable action –  varArray variable (Array type). Value: [ { "Name": "John", "Date": "10/12/2022" }, { "Name": "Jeff", "Date": "09/16/2022" } ] 2) Create CSV table action. From: variables('varArray') 3) Initialize variable action –  CRLF variable (String type). Value: uriComponentToString('%0D%0A') 4) Get file metadata using path action. Peek code: "parameters": {…

Continue ReadingPower Automate – add more data to a CSV log file

SharePoint Column Formatting – use JSON to show column data in a pop-up window

Sometimes a SharePoint column has too much information, which eventually stretches rows and distorts the look. An example below is a Multiple lines of text type column: This simple JSON code is useful to hide noncrucial information, while still allowing easy access to that data by hovering your mouse cursor over it. { "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json", "elmType": "div", "style": { "display": "=if(@currentField, '','none')", "font-size": "12px" }, "txtContent": "Hover to see more", "customCardProps": { "formatter": { "elmType": "div", "txtContent": "@currentField", "style": { "padding": "5px 5px 5px 5px", "border": "solid", "border-radius": "2px", "border-width": "1px", "box-shadow": "0 0 2px 0" } }, "openOnEvent": "hover", "directionalHint": "bottomCenter", "isBeakVisible": false } }

Continue ReadingSharePoint Column Formatting – use JSON to show column data in a pop-up window

PowerShell – SharePoint – Move folders between site collections, subsites, and libraries

There are several ways to move data between libraries in SharePoint. One of them is using UI. While this method has become better over the years, it's still slow and buggy at times. Just recently I had an issue where SharePoint UI would not move more than 20 folders, it would time out.  Another method is using PowerShell to do such a task. Out there you can definitely find scripts that would move data; however, you need to provide all prerequisite information and do it correctly. A typo or a library display name vs different internal name would leave you scratching your head for quite some time. If you do use subsites in your site collections, then things become progressively more complicated. To address most of the struggle I decided to create a script that will do it all. The goal was to automate everything where an admin would only…

Continue ReadingPowerShell – SharePoint – Move folders between site collections, subsites, and libraries

PowerShell – SharePoint – Permission report for all lists and libraries within every site collection and subsite

Here is a script that comes very handy when you need to replace some SharePoint groups with other ones. While doing so you definitely want to make sure no one has lost access. So you need to know where each group has been used. To create this script I used Salaudeen Rajack's PnP PowerShell to Export Document Library Permissions in SharePoint Online script posted here (https://www.sharepointdiary.com/2019/02/sharepoint-online-pnp-powershell-to-export-document-library-permissions.html), then did some adjustments to it including converting it to a function. Then added my code to go through each site collection and subsite. What this script does and how it might be beneficial to you: goes through every site collection and subsite, then library and list; has a list of site collections to exclude; does not include Office 365 Group sites; outputs the following data - site/subsite URL, library/list title, user/group name, user/group type, permission level, how it's granted. This script might take…

Continue ReadingPowerShell – SharePoint – Permission report for all lists and libraries within every site collection and subsite

PowerApps Form – submit multiple forms at once without Patch and extra buttons

Everyone knows that PowerApps Forms are much trickier than their siblings - PowerApps Apps. So when it comes to creating a multi form experience it's not the same for PowerApps Forms. In fact Microsoft PowerApps Team recommends using a Patch function or other workarounds. So officially multi forms for PowerApps Forms are not supported. It's obvious why one would like to use multiple forms over a huge single form - a better user experience and a natural feel. So it is doable and the benefits of using it the way I described below are: No extra buttons. While a custom button can compliment your form and expand its functionality, you still have standard buttons you cannot hide. All columns can stay required on a SharePoint level. The forms will react to those required fields as needed. No Patch function. Don't get me wrong, the Patch function is very useful but…

Continue ReadingPowerApps Form – submit multiple forms at once without Patch and extra buttons

SharePoint Column Formatting – hide Title column and use JSON to show View and Edit buttons in any column

It’s not always convenient to use a default Title column that comes standard with a newly created SharePoint list. PowerApps form can take care of it and add some logic to it but it is still a Single line of text column. To make it even more complicated to remove, that Title column ties to a "view/edit an item" link. If you still want to get rid of it and not lose any functionality you can use a simple JSON code below: { "elmType": "a", "txtContent": "@currentField", "attributes": { "href": "='https://contoso.sharepoint.com/sites/dev/Lists/TestList/DispForm.aspx?ID='+[$ID]" }, "style": { "padding": "10px", "font-weight": "bold" } } However, this method has quite a few downsides: when closing a form, it redirects to a Default view (it is possible to specify which view to go but that might be a lot of hard-coding depending on how many views you have); the link is hard-coded; does not seem to open "modern…

Continue ReadingSharePoint Column Formatting – hide Title column and use JSON to show View and Edit buttons in any column

Microsoft Flow – archive SharePoint List data into a single Excel file

  • Post category:Flow
  • Post comments:0 Comments

This post is about a quite simple task to achieve - archiving SharePoint List data into a single Excel file that is stored in a Document Library. I think it is important to go through this process to show the basics and have it as a prerequisite for a more complicated process - archiving data into multiple excel files. There are several reasons why one would archive data into Excel: excel file is easy to move or share; it is very fast to work with (no paging, no 5000 item limit view threshold). Let's create a SharePoint List with different types of columns (single line text, date, number, choice): Then we add a few test items: After that we create a Document Library and put an Excel file into it: That Excel file should have a table in it and the same columns as our SharePoint List. The formatting of…

Continue ReadingMicrosoft Flow – archive SharePoint List data into a single Excel file

PowerShell – change the storage space for a specific user’s OneDrive

As an admin you can easily make an adjustment of a OneDrive storage limit for all users through a OneDrive admin center. If you need to do the same for a specific user, here is a Microsoft article that describes that - https://docs.microsoft.com/en-us/onedrive/change-user-storage Truth is, it only takes a single line of code to make an adjustment; however, my script below takes care of most little things, requirements, and inconveniences: you only need an email address of a user; the minimum size of allocated space is 1 GB; the maximum size is 5 TB. $email = Read-Host "Please provide an email address of the user" $convertedemail = $email -replace "\.","_" -replace "@","_" $partofthelink = "-my.sharepoint.com/personal/" + $convertedemail $onedriveurl = Get-SPOSite -IncludePersonalSite $true -Limit all -Filter "Url -like $partofthelink" $onedriveurl Do { Try { $num = $true [int]$sizegb = Read-Host "Please specify the size of OneDrive storage space to be set…

Continue ReadingPowerShell – change the storage space for a specific user’s OneDrive

PowerApps – enhance Combo Box search functionality

Even out of the box PowerApps is a great tool that provides lots of functionality. Way more than InfoPath could. However, most of the time with very few adjustments it is possible to achieve even more. A great example would be a Combo Box and its search ability. Let's create a SharePoint list with a Choice column and these values: It doesn't really have to be a Choice column, you might as well use a Lookup column. When a PowerApps form is created, the studio creates a Data Card and a Combo Box control associated with that Choice field. Let's see how the search in that Combo Box works and why it is limited in its current state. Note how it finds BK but doesn't find Black. The search has a StartsWith behavior. What if it is necessary to search for a word regardless of its position. Well, that's very easy…

Continue ReadingPowerApps – enhance Combo Box search functionality

SharePoint – enable or disable Share option per each library within a site

This post is about how to enable or disable Share option for each library within a SharePoint subsite. There are different suggestions that worked for some but didn't for the others in this stackexchange topic - https://sharepoint.stackexchange.com/questions/208090/how-do-i-disable-get-a-link-share I found a way to control it by adjusting Access Requests Settings and Permission levels. Unfortunately it's almost impossible to find any documentation on what each Permission option does. Let's see how it all works together. Microsoft is known to change things down the road, so the settings that work today might not in the future. Please test everything before moving forward in your production environment. So here is a test subsite with two document libraries: The first requirement is Allow members to share the site and individual files and folders must be checked: Second, on your main site within a site collection you need to create a copy of the Contribute permission level, name it Contribute…

Continue ReadingSharePoint – enable or disable Share option per each library within a site