sharepoint online – Prevent User with Read Permission to have access to site content and site usage

I have created a group and assign the Read permission to it. I modified the the Read permission to the below to prevent the site usage and site content access.

List Permissions:

  1. View Items
  2. Open Items

Site Permissions:

1.View Pages

2.Use Remote Interfaces

3.Open

Now the permission work perfectly my users do not have access to site usage and content. But my navigation on my home page does not show up. Basically the navigation is just 3 links pointing to three views of the same list. I do get access to the list when i manually visit the list thought.

I am using modern pages and list. When i set the permission “VIew application pages” my navigation come back but then i get the issue of my users being able to access site usage and site content

sharepoint online – How to launch home page on Power Apps Forms submit button Click in same tab?

I have a list and we have customized the edit form in Power Apps. We have set this forms link in Email that we send to manager when new entry is added. He must review it and change status choice to approve and click save. But we need to open our homepage on submit click instead redirecting to list, we need to redirect to homepage.

We have tried below solutions so far:

  • Use source parameter as we do in classic site but it is not working. We are redirecting to list.

Reference – Customize newform save button – Save and redirect to another form

  • Use launch command. In this we have provided Launch option with home page and with demo page as well. In this scenario, the page is open in new tab. and current tab is redirecting to list.Here is my save code –
SubmitForm(SharePointForm1); Launch("Home page URL or Demo test page url");

Reference – https://powerusers.microsoft.com/t5/Building-Power-Apps/Submit-form-and-navigate-to-different-screen-Not-SharePoint/m-p/73761

  • Use launch command with Launch Target option. I tried the latest replace option as well. But still we are redirecting to the list.
    Here is my save code –
SubmitForm(SharePointForm1); Launch("Home page URL",{},LaunchTarget.Replace);

Reference – https://powerusers.microsoft.com/t5/Power-Apps-Ideas/Launch-URL-from-within-PowerApps-form-IN-THE-SAME-TAB/idi-p/279955#:~:text=Launch%20URL%20from%20within%20PowerApps%20form%20%2D%20IN%20THE%20SAME%20TAB&text=If%20that%20is%20not%20wanted,rather%20than%20the%20same%20tab.

Can someone help me with this?

sharepoint online – MS Flow – Approval Email – Markdown Table

Since this a complex array, I used a combination of (Parse JSON) and (Apply to each) actions, and string functions to generate the HTML table to get the output as requested.

See the screenshots and explanation below.

enter image description here

varArray – a string variable, contains the array string that has been provided.

varHTMLTable – a string variable, initialized with a Table layout with some styles. See Expression 1.

Expression 1

<!DOCTYPE html>
<html>
<head>
<style>
th, td {
  border-left: 1px solid black;
  padding: 5px;
  width:200px;
}
th {text-align:left; }

</style>
</head>
<body>

<table style="width:50%">
  <tr>
    <th>Header</th>
    <th>Data</th> 
    <th></th>
  </tr>
<!--add a blank row between (Header) and (Data) Rows -->
  <tr>
    <td style="border:0px;">&nbsp;</td>
    <td style="border:0px;">&nbsp;</td>
    <td style="border:0px;">&nbsp;</td>
  </tr>

Detail 1

enter image description here

Expression 2

concat('<tr><td>', items('Apply_to_each')('Header')?(0), '</td><td>', items('Apply_to_each')('Data')?(0), '</td><td> </td></tr>',

'<tr><td>', items('Apply_to_each')('Header')?(1), '</td><td>', items('Apply_to_each')('Data')?(1), '</td><td> </td></tr>',

'<tr><td>', items('Apply_to_each')('Header')?(2), '</td><td>', items('Apply_to_each')('Data')?(2), '</td><td> </td></tr>'

)

Detail 2

enter image description here

The Final output seen in the email body

Note: Table styles can be adjusted as needed.

enter image description here

How to copy Content Type from one site collection to another (Both site collection having different template) SharePoint Online

We are looking for copy a content type from one site collection to another.

Both site collection having different site template.

How to copy content Type from one site collection to another in SharePoint Online using PowerShell?

Remove Dead space from SharePoint Modern Team site

This is by design, we have to use custom code to achieve it.

We can use SPFx Applications Customiser to inject the following CSS style for the modern pages.

.CanvasZone{
    max-width: none !important;
}

enter image description here

Solution with source code: SPFx Applications Customiser CSS Injection

Unable to open SharePoint online site in SharePoint designer

Stack Exchange Network


Stack Exchange network consists of 176 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Move Roller Blog (Moveable type) to SharePoint online modern site

Stack Exchange Network


Stack Exchange network consists of 176 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

sharepoint server – Exception in String type error on SPFX with JQuery

I really need help to resolve Type error encountered on this function in SPFX with JQuery. Here is the function: The return statement is failing:

var addFile = function (fileTitle, fileName, fileType, team) {
var requestUri = "../_api/web/lists/getByTitle('SPFxFiles')/items";
var requestHeaders = {
    "accept": "application/json;odata=verbose",
    "content-type": "application/json;odata=verbose",
    "X-RequestDigest": $('#__REQUESTDIGEST').val()
}
var fileData = {
    __metadata: { "type": "SP.Data.SPFxFilesListItem" },
    Title: fileTitle,
    SPFxFileName: fileName,
    SPFxFileType: fileType,
    SPFxTeam: team
};
var requestBody = JSON.stringify(fileData);
return $.ajax({
    url: requestUri,
    type: "POST",
    headers: requestHeaders,
    data: requestBody
});

{
“resource”: “…/src/webparts/orderForm/OrderFormWebPart.ts”,
“owner”: “typescript”,
“code”: “2769”,
“severity”: 8,
“message”: “No overload matches this call.n Overload 1 of 2, ‘(url: string, settings?: AjaxSettings): jqXHR’, gave the following error.n Argument of type ‘{ url: string; type: string; contentType: string; headers: { accept: string; “X-HTTP-Method”: string; “X-RequestDigest”: string | number | string(); “If-Match”: string | number | string(); }; data: string; }’ is not assignable to parameter of type ‘string’.n Overload 2 of 2, ‘(settings?: AjaxSettings): jqXHR’, gave the following error.n Type ‘{ accept: string; “X-HTTP-Method”: string; “X-RequestDigest”: string | number | string(); “If-Match”: string | number | string(); }’ is not assignable to type ‘PlainObject’.n Property ‘”X-RequestDigest”‘ is incompatible with index signature.n Type ‘string | number | string()’ is not assignable to type ‘string’.n Type ‘number’ is not assignable to type ‘string’.”,
“source”: “ts”,
“startLineNumber”: 317,
“startColumn”: 8,
“endLineNumber”: 323,
“endColumn”: 3,
“relatedInformation”: (
{
“startLineNumber”: 165,
“startColumn”: 13,
“endLineNumber”: 165,
“endColumn”: 20,
“message”: “The expected type comes from property ‘headers’ which is declared here on type ‘AjaxSettings'”,
“resource”: “…/node_modules/@types/jquery/misc.d.ts”
}
)
}

sharepoint online – Get-PnPList cmdlet not returning anything

I’m trying to retrieve information from two columns on a sharepoint list in order to use them in powershell. Here’s my code so far:

    $SiteURL = "https://xxxx.sharepoint.com/sites/xxxxx/"
    
    #Connect to PNP Online
    $creds = Get-AutomationPSCredential -Name "xxxxxxx" 
    Connect-PnPOnline -Url https://xxxxx-admin.sharepoint.com/ -Credentials $creds
     
    #Get a list by name
    $FetchList = Get-PnPList -Identity Lists/xxxxxxx
    
    #sharepoint online pnp powershell get list items 
    $ListItems = (Get-PnPListItem -List $FetchList -Fields "Host").FieldValues

 
#Loop through each Item
foreach($ListItem in $ListItems)
{  
    Write-Host "Title:" $ListItem("Title") 
}

The loop should be printing the values on the column “Host”, but it’s not printing anything.
And my problem is, the Get-PnPList keeps returning null, meaning I’m getting no output while I’m looping through everything. I’ve tried using list id, list name, everything and it always returns null. Am I missing something? I’m creating this in an Azure runbook.
I even tried to simply invoke Get-PnPList with no arguments, which according to the documentation for that cmdlet it should return every single available list for that website, but it still returns null (I tried printing the output which should have been a Microsoft.SharePoint.Client.List object, but nothing appears).
I can confirm the $SiteURL is correct because I used powerautomate which auto-completes to the correct URL.

Thank you.

sharepoint online – While setting up new SPFX environment getting Error of unsupportability

I am trying to set up an environment for SPFX development. I tried to install the latest version of nodejs.

I installed latest version of nodejs 14.15.4 and automatically npm verion 6.14.11 installed.

Then installed
“npm install -g yo gulp” successfully.But while installing “npm install -g @microsoft/generator-sharepoint” got below error:

C:SPFX>npm install -g @microsoft/generator-sharepoint
npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated axios@0.18.1: Critical security vulnerability fixed in v0.21.1. For more information, see https://github.com/axios/axios/pull/3410
npm WARN deprecated har-validator@5.1.5: this library is no longer supported
npm WARN notsup Unsupported engine for got@5.7.1: wanted: {"node":">=0.10.0 <7"} (current: {"node":"14.15.4","npm":"6.14.11"})
npm WARN notsup Not compatible with your version of node/npm: got@5.7.1

+ @microsoft/generator-sharepoint@1.11.0
updated 1 package in 9.888s

Now if I try to create new SPFX project using command “yo @microsoft/sharepoint” then simply nothing is getting created inside the project folder.

Kindly help me to resolve this. Thanks in advance!