How do I get the existing preview URL for a driveItem? (not the temporary preview functionality) - sharepoint

In M365 you can select the context menu of a document and click Preview.
This takes you a URL of the form:
https://site.sharepoint.com/etc.../etc/something?id=pathtodocument&parent=pathtoparent
How do I get this URL from Microsft Graph?
All of the URLs I've found so far have not quite been what I needed, I would rather not have to try to stitch together the site information, the document and parent paths myself

Related

How to make Powerapps work with Param function in Web Part

I am trying to create a powerapps web part that will open a specific screen from a canvas app using parameters. I have added the web part and added the power apps web link to it. When I enter &parametername=parameter nothing shows up. I can enter the web link and parameters directly into a browser window (tried in Chrome and Edge) and the app will display properly. I can also created a button in a web part and added the link to it and it will also display the app when the button is clicked. The app is working properly with no errors, it will just not show up in the web part when the parameters are added to the link (If no parameters are added to the link, everything will display fine).
I am trying to create a powerapps web part that will open a specific screen from a canvas app using parameters. I have added the web part and added the power apps web link to it. When I enter &parametername=parameter nothing shows up. I can enter the web link and parameters directly into a browser window (tried in Chrome and Edge) and the app will display properly. I can also created a button in a web part and added the link to it and it will also display the app when the button is clicked. The app is working properly with no errors, it will just not show up in the web part when the parameters are added to the link (If no parameters are added to the link, everything will display fine).
I was struggling with this myself; just figured it out.
You need to put the full URL with parameters in to the "App web link or ID" property for the PowerApp web part. Be careful because the first parameter needs to be prepended with ? not &. The ampersand is used for additional, following parameters after the first parameter.
Note that I have omitted my TLD from this screenshot, however you will want to substitute your own here.
The example URL syntax given by Microsoft is https://apps.powerapps.com/play/{App ID}?{Query}. For me that URL looks something like this:
https://apps.powerapps.com/play/f813580f-3182-90b0-b3a9-781cfb288808?linkId=checkIn
I have one URL for checkIn and another for checkOut that I can use to display different forms.
My primary mistake was that I was only pasting my appID into the "App web link or ID" field rather than the entire URL. Remember, you can edit your Canvas Form, click on "Share" and get the Web Link from this page. This contains the full URL, minus your custom parameters. Play around with the full URL plus parameters until you get something that the web part will accept.

How to update link to documents in Sharepoint

Recently, we updated the URL for our Sharepoint site. I have added AAMs to direct any users trying to access the site through the old URL to the new URL. So far, everything has been working fine. Recently, while browsing through a document library, I noticed when I clicked on the ellipses on the name of a document so I could copy the link associated to the document, the URL appears as http://NewSiteURl/http://OldSiteURL/...
I notice it is not every single document in my library that presents links like this, but I do notice it in random documents throughout the library. How can I fix this issue so all links to documents within the library so it doesn't contain the old site url?

Using Microsoft Graph API to Query Certain Sharepoint URIs with .aspx Extensions

I have a question about sharepoint combined with the graph API. I'm trying to do a GET request against a sharepoint site, but it doesn't populate when the url has a .aspx extension. For example if I do 'GET https://graph.microsoft.com/v1.0/sites/hostname.sharepoint.com:/sites/blablabla/UK' this populates a response fine, but if I do 'GET https://graph.microsoft.com/v1.0/sites/hostname.sharepoint.com:/sites/blablabla/UKDTAppKZ/something.aspx' then I get a 404 error suggesting this site doesn't exist... Could I get some clarification on how to use graph GET queries with sharepoint urls, specifically .aspx extensions?
In your first URL you're accessing the Site object for the /sites/blablabla/UK sub site, so you should get back a valid site object (assuming the URL is correct) as you indicated. To access the files in that site you need to access the Drives (Document Libraries) and then get the children or the specific item you're looking for. So the URL would look something like:
Path support isn't always consistent right now so wherever possible I like to use IDs if I know them.
So with an ID it would be:
https://graph.microsoft.com/v1.0/sites/HOSTNAME.sharepoint.com,SITECOLLECTIONGUID,SITEGUID/drives/DRIVEID/root/children
OR
https://graph.microsoft.com/v1.0/sites/HOSTNAME.sharepoint.com,SITECOLLECTIONGUID,SITEGUID/drives/DRIVEID/items/ITEMID
For Pages specifically though I would take a look at the Beta Pages API we added recently. If you want to do any operations (like publishing) to the page you'll want that API instead of the basic drive API.

Access files of Document Library site through Microsoft Graph API

I was wondering if the two following queries are actually the same or supposed to be the same:
GET https://graph.microsoft.com/beta/sharepoint/sites/{spsite-id},{spweb-id}/drives
and
GET https://graph.microsoft.com/beta/sharepoint/sites:/MYPATH:/drives
I would like to access a Document Library Item in a sharepoint site through the relative path.
Please mind that both endpoints below are the same for getting all doc libraries or drive in a site according to the current beta microsoft graph documentation. The latter becomes handy when you dont know the site id yet but the relative site url.
https://graph.microsoft.com/beta/sites/[domain.sharepoint.com]:/[relative-url]:/drives
https://graph.microsoft.com/beta/sites/[site-id]/drives
(e.g. site id: "cie493742.sharepoint.com,4af352a7-a53b-43d9-b0a3-da372b392ea0,52c490f3-3354-40b9-a3c9-fefb08cb5c88" )
Now to get the document library item
Get Document library id from list of drives
https://graph.microsoft.com/beta/sites/[site-id]/drives
Get item id from list of items
https://graph.microsoft.com/beta/sites/[site-id]/drives/[drive-id]/items
Final API call
https://graph.microsoft.com/beta/sites/[site-id]/drives/[drive-id]/items/[item-id]
you could try experimenting the Graph API from here

Email view that does not show buttons and views of other activities

I want to add Emails to navigation so It can be used like any other entity. Editing sitemap is not a problem but it does not work in the expected way.
First, of all it shows all entities, not emails only. And consequently there are filters for other activities which are unwanted.
How do I make email-view that does not show other activities?
Create a new view in CRM showing the records you wish to see
Create a HTML web resource, with an iFrame pointing to the URL of the view you just created. It will look something like this /advancedfind/advfind.aspx?AutoRun=true&QueryId=%7b495B7974-58AC-E234-92D4-EE155D107003%7d&ViewType=4230&etn=email
Point your sitemap to the new web resource

Resources