Posts

Showing posts from 2022

Power Automate Copy SharePoint Page Content to another page in another site

Image
This step is part for the large post Duplicate Sharepoint Online Subsite with all Site Contents and Page[s] - Power Automate But can be used individually. The process is simple, in modern pages they did it so when you save/publish your page they send an ajax request with all the content, so you can just copy all that content and make your own HTTP with that content to update the desired page. After this  you can browse this additional content 1 - copy page and add it to navigation 2 - edit the content that you copy This is a 3 part tutorial 1 - get the data for page content 2 - prepare some data on item created (trigger) 3  - checkout / save  / publish page Part 1 - get the data for page content 1. Open browser and go to your template page (page you want to copy) 2. Edit page  3. Open develpopers tools (F12) and go to Network tab 4. Check the "Preserve log button" 5. Save/Publish the page 6. In the filter write "save" 7. Click View Source to change the date from par...

Power Automate Create sites scripts, designs, and archive for later use

Image
 This step is part of the longer post  Duplicate Sharepoint Online Subsite with all Site Contents and Page[s] - Power Automate And therefor was moved to a seperated post. 3. Create sites scripts, designs, and archive This is a 1-time process (for each design), so it should live as a manually triggered flow. Whenever you make a change, you need to run this again (and change what is relevant, if needed). REMEMBER - that will only affect newly created subsites, not old ones! I will show 1 Flow for 1 template, and you should create multiple, 1 for each template This is the full flow, and I will explain each piece Steps 1-3:  1 - Trigger, nothing to it, 2 - Initialize Variable type of Array, to store the array of our lists and libraries to be copied 3 - Get all lists, retrieve all Custom Lists and Document Libraries Display Names, from the Template Site (in my example - "ITX2-root") NOTICE - this is problematic in 2 ways: First it retrieves only the Display Names, meaning that...

Duplicate Sharepoint Online Subsite with all Site Contents and Page[s] - Power Automate

Image
 Too many was written, too scattered. So i'll try to make something complete. Our client wans a simple flow, when SP Items is created, duplicate 2 Template Sites, BOTH ARE SUBSITES, with the Document Libraries (can be also lists), and squeeze in (inject) some content (to the pages). Well 1st let me add that if the request would have included some design, or being a Root Site (like when you click "SharePoint" and "Create Site") than you would definitely use the "Create Site Design" ect. to some Library and apply it. But for me its different, so lets describe the actual steps: Its a bit of a process but I believe that you can take it in less than 1 hour with this full tutorial Table of Content 1. Build 2 ROOT sites and design them, theme, lists, libraries, columns (no content! - for content only PNP xml Engine) 2. Create helper lists in helper site (just another side site for some management) 3. Create sites scripts, designs, and archive for later use (r...

BadGateway (502) CreateSiteScript Power Automate

 using endpoint  /_api/Microsoft.SharePoint.Utilities.WebTemplateExtensions.SiteScriptUtility.CreateSiteScript(Title=@title)?@title='DemoSiteScript' we got error  BadGateway solution - user must be SharePoint Admin

SPFx REAL compatibily materix

Image
Links for sources at the bottom, including Version Notes General Recommendations: 1. Use nvm  (nvm install <nodeVersion>, nvm use <nodeVersion>) ( official site ) 2. The rest do not install with -g 3. Sometimes the best solution is to uninstall node and clean npm from AppData 4. Testing CMD's at the bottom end [click the table to enlarge] According to this stackoverflow answers  they all prefer, at least up to spfx 1.11.0, and with node 10.x, to use gulp 3.9.1 and yo 3.1.0 SOURCES for versioning items SPFx - https://docs.microsoft.com/en-us/sharepoint/dev/spfx/compatibility Node.js support for NPM - https://nodejs.org/en/download/releases/ Gulp, Yeoman, and OnPrem - https://docs.microsoft.com/en-us/sharepoint/dev/spfx/sharepoint-2019-support#nodejs-gulp--yeoman-versions Angular according - https://gist.github.com/LayZeeDK/c822cc812f75bb07b7c55d07ba2719b3 node-sass version lock - https://bresleveloper.blogspot.com/2022/03/spfx-make-applicat...

Flow How to test if MultiChoice is empty array?

Usually this should be empty, null or empty string. But after my migration  1. find the value, with loops it can be something like "items('Apply_to_each_2')?['Value']" 2. init variable and set it as Expression "string(items('Apply_to_each_2')?['Value'])" 3. test is vs "string('[]')"

SPFX Make Application Customizer for version 1.8.x

github solution made just for you ♥  1. create 2 projects, 1 as "2019 onwards" to select "Application Customizer" and another simple for SPO, I am assuming that the yo version in your machine is 1.8.x npm ls -g --depth=0 @microsoft/generator-sharepoint 2.  change accordingly values in       "/config/config.json"      "/config/package-solution.json" make sure you change words "webparts" to "extensions", also adding "ApplicationCustomizer" everywhere, including "...Strings" in last line of config.json create the "..ApplicationCustomizer.ts" file and all the files in its folder and create the 2 XML files under "sharepoint/assets" copy the GUID from "..ApplicationCustomizer.manifest.json"  to the XML's (and serve.json) 3. create npm-shrinkwrap.json with the following {     "dependencies" : {         "graceful-fs" : {             "version" : "4...