Posts

Showing posts from 2022

You cannot edit this page - SharePoint online modern page

Image
Environment  SharePoint online Problem  When working with pages I sometimes get this error when trying to edit or republish the page.   Solution To resolve this error, we need to change the content type to Site page. Go to the Site contents  And open the Site Pages library Chances are that the page is still checked out. Check it in or discard check out. Select the page Click on the i  to show the details Select Site Page  for the content type (If the content type is Site Page, then select Wiki Page, publish the page, and repeat the steps above to select Site Page) Now you can edit and republish the page

Show a users display name in a PnP Modern Search Results Web Part using handlebars helpers

Image
Show display name in a PnP Modern Search Results Web Part using handlebars helpers. I have added a search results web part to a page to show a list of my projects. One of the columns should show who is the Project Manager. To do that I used the details list and configured the columns as shown in the images below.     In row 4 I entered {{ProjectmanagerOWSUSER}} This produces:  pkops@hxxxxr.nl | Pieter Kops | 693A30232E667C6D656D626572736869707C706B6F7073406861757A657 Then I found out how to use handlebars and came up with this: {{itemAt (split ProjectmanagerOWSUSER "|") 1}} And that gave me my display name: Pieter Kops How does it work First split the ProjectnmanagerOWSUSER field at the | sign This creates an array of 3 values… 0 - pkops@hxxxxr.nl 1 - Pieter Kops 2 - 693A30232E667C6D656D626572736869707C706B6F7073406861757A657 Next take the number 1 value of the array More info on handlebars https://github.com/helpers/handlebars-helpers/

Start power automate on new or modified document only when a condition is met

Image
Starting a Power Automate flow on a new or changed document or item is easy. But can you only start it when a certain condition is met?  Yes, you can. In this example I only want to start the flow when the field "Document Status" is set to "To review". Here's how. The trigger for this flow is: When a file is created or modified We need to go to the settings of this action... Add a trigger condition... @equals(triggerOutputs()?['body/Document_x0020_Status/Value'], 'To review') Click Done and now the flow will only start if the condition is met. Bonus tip! If you find it hard to create the trigger condition expression do this: Pick the field you want to compare against... Enter the value and click on "Edit in advanced mode"  Select the expression and copy it into the trigger action from above. After this you can delete the Do until action.

Dynamic content not available in Power Automate

Image
Scenario After I added a "Post adaptive card and wait for a response" action the dynamic content of that action was not available to select from. The adaptive card asks for an approval using this code: {    "type": "ActionSet",    "actions": [    {       "type": "Action.Submit",       "title": "Approve",       "id": "Approve"    },    {       "type": "Action.Submit",       "title": "Reject",       "id": "Reject"    }    ] } If you want to know more about adaptive cards and how to format them, go here ! After that the submitActionId was not available in the dynamic content. To find out what dynamic content you need in subsequent actions just test your flow and check the output of the "Post adaptive card and wait for a response" action. To use outcomes from the previous action is manually entered the folowing expression: