Is it possible to create a project documentset using graph API? - api

So far I haven't been able to find any information on how to create project documentsets on my Sharepoint environment using the Graph API. I've tried both Sharepoint's 'Create item' and OneDrive's 'Create Folder'. The Sharepoint API says:
"Files and folders should only be added to a DocumentLibrary via the OneDrive API"
The OneDrive API says:
"Either 'folder' or 'file' must be provided, but not both."
As you can tell from the responses, it seems limited to only having the options to create either a folder or a file. Is this correct? Is there any way to mutate a folder to a document set using a different API call?
I have tried to add the content type ID to the different request bodies, in every case providing no further solution.
Hope someone here knows a possible solution and can help me. Thanks!

I've dealt with the same issue today. I needed to create a Document Set in the root level of a Document Library after some business logic.
Here's how I've achieved to do so:
1- Get the document library's Drive Id:
GET https://graph.microsoft.com/v1.0/sites/${siteId}/lists/${listId}?$expand=drive
2- Create the folder:
POST https://graph.microsoft.com/v1.0/drives/${library.drive.id}/root/children
Remember to set the body as:
{
"name": ${nameOfTheFolder},
"folder": {},
}
3- Get the folder's SharePoint item id:
GET https://graph.microsoft.com/v1.0/sites/${siteId}/drives/${library.drive.id}/items/${folder.id}?expand=sharepointids
4- Update the item in the Document Library so that it updates to the desired Document Set:
PATCH https://graph.microsoft.com/v1.0/sites/${siteId}/lists/${listId}/items/${sharepointIds.listItemId}
Don't forget to set the body to:
{
"contentType": {
"id": "content-type-id-of-the-document-set"
},
"fields": {
//whatever fields you want to set
}
}
Hope it helps

I have been looking into this myself aswell and walked into the same wall.
At the moment, unfortunately, there is no combined method.
You can use them both to combine it to your own documentset.
Kind regards,
R Schouten

Related

Integromat - Google Calendar - How to add attachment to event with "Make an API call"

I would like to add attachment to Google calendar event with integromat "Make an API call" module. Attachment uploaded previously to Google drive.
I dont know how to setup the "MAKE an API call" module. See screenshot below.
I tried to understand the integromat help for this, but it was a little bit difficult for me.
If somebody have a scenario for this please help me.
Thanks for any help!
I am pretty sure that Google Calendar API doesn't support external files as part of the attachment, I might be wrong though. The current working scenario, that I shared will be able to add a Google Drive File as part of the attachment. Please refer the screenshot,
You will need to use following,
URL: /v3/calendars/{{CALENDAR_ID}}/events/{{EVENT_ID}}?supportsAttachments=true
Method: PATCH
Body :
{
"attachments": [{
"fileId" : "",
"fileUrl": "https://drive.google.com/file/d/1yyVVQxgwb7wF6RckN_1KoGtSmikjk2MR/view?usp=sharing",
"mimeType": "image/png",
"title": "TestImage.png"
}]
}
You can refer the document here : https://developers.google.com/calendar/api/v3/reference/events/patch

Xcode - how to change file's target membership via command line?

Is there a way to change file's target membership in Xcode project via command line?
Here's what I'm trying to do via Xcode's UI:
I also had to do this for CI. After lots of digging, I do not believe this is common enough for anyone to have written a tool to help with doing.
The only conclusion I came to was to edit the project.pbxproj file directly, which is never a great thing to do. None of the tools which claim to do this were of any help until I found this stackoverflow answer on editing the project.pbxproj file. Essentially, you can convert the project.pbxproj file into a JSON format using plutil -convert json project.pbxproj and use a JSON manipulation tool to make those files as headers then point them to be headers of whichever target you would like.
When converting the project.pbxproj into JSON format, be aware that Xcode will no longer be able to show you the project navigator for that project. It will still build and run, however, so this is really only useful if you're planning to do this right before building (such as for CI).
(EDIT: As of July 2022, Xcode will now properly read a JSON version of its .pbxproj to allow you to view your files in the project navigator. I'm not sure which version introduced this, but it is at least now possible with later versions of Xcode.)
The format project.pbxproj as JSON has nearly all the important data under the "objects" key. The file you want to be a header already has an entry with the key being the UUID for the file and a path value you can use to relate the UUID to your file. Here's an example of that format:
// UUID for your file
"65TYSSDXHSLP4UUOAD9D40C322AAGHM9": {
"path": "MyHeader.h", // Your file's name
"isa": "PBXFileReference",
"includeInIndex": "1",
"lastKnownFileType": "sourcecode.c.h",
"sourceTree": "<group>"
}
There's another entry to declare this file as a header, which has its own UUID and a reference to the UUID of your file:
// UUID for your file as a header
"YU3BSD39O9PT5RESDFV741D1": {
"isa": "PBXBuildFile",
"fileRef": "65TYSSDXHSLP4UUOAD9D40C322AAGHM9", // UUID for your file MyHeader.h
"settings": {
"ATTRIBUTES": [
"Public" // could also be Project or Private
]
}
}
Then finally, your target has a list of header files where you will want the UUID for the header reference to go.
"A82GAE9A5HUIO063IOPQAAQIUFGSNXZ": {
"isa": "PBXHeadersBuildPhase",
"buildActionMask": "2147483647",
"files": [
"YU3BSD39O9PT5RESDFV741D1" // UUID for your file as a header
],
"runOnlyForDeploymentPostprocessing": "0"
}
Again, changing the project.pbxproj file directly is never a great idea, but until there's a better tool for making these changes without using Xcode, it's the best I could find. If anyone else is aware of something I'm not, please let me know.

Unable to add image to Outlook Online

I want to add an image to my mail body by Office.js but this is not working for Outlook Online.
I don't want my picture to be accessible for everyone so this is what I do (this works for Outlook Desktop):
Add an attachment by url
Office.context.mailbox.item.addFileAttachmentAsync(url, name,
{ isInline: true },
function (asyncResult) {
...
});
Add image to body
Office.context.mailbox.item.body.setSelectedDataAsync('<img src="cid:' + name + '">',
{ coercionType: Office.CoercionType.Html },
function (asyncResult) {
});
After the file is attached we remove the image so it isn't available anymore at the url.
How do I get adding file attachments to work for Outlook Online?
As I understood your issue, the recipients, as well as yourself is not able to see the photo that you've embedded on a email. Am I correct? The following are the possible reasons affecting the issue:
Possible that the file size of the picture maybe too large
A possible issue on recipients's end (browser issue)
Slow nternet connection
For more information, please refer to the link below:Unable to insert a photo in Outlook.com
Hopefully it helps you!

Custom Grid App

So I am trying to make modifications to the custom grid app that rally has already created. I found the source code at https://github.com/RallyApps/app-catalog/tree/master/src/apps/grid. However, I cannot get that code to work. I have added it to a js and then ran build (I also changed the json). However, when I then add the app to rally it doesn't give me the settings options (object, query, pagesize, etc) and just generates a table. This table generates 4 rows (the number of user stories I have), but the rows are completely blank except for gears at the beginning of each row. I was wondering if I was building this app incorrectly or if I had grabbed the wrong code. If not, is there a place where can I get the complete code or a way to modify the already existing code?
Thanks
You may add a fetch to the config as below:
config: {
defaultSettings: {
types: 'hierarchicalrequirement',
fetch: 'FormattedID,Name'
}
}
and it will display a grid.
It will not display settings dialog however. The source code in this github repo is not exactly the CustomGrid app available from the AppCatalog in the UI. It does not have the full functionality and not ready yet. I submitted a defect.

Load Dojo class from string content instead of file

For a very special situation I want to store Dojo classes (i.e. the sources) that I load from remote in the localStorage to have access to them in offline situations (we are talking about a hybrid mobile app). I got everything running but dojo.eval won't let me create the class from a string like this
var data = 'define(["dojo/_base/kernel",...'; // class definition as string
dojo.eval(data);
Any idea how to accomplish this?
If you need to have your app run offline, store the resources (css, images, js) in the app manifest. The manifest file looks like the following.
{
"name": "My App",
"description": "My elevator pitch goes here",
"launch_path": "/",
"icons": {
"128": "/img/icon-128.png"
},
"developer": {
"name": "Your name or organization",
"url": "http://your-homepage-here.org"
},
"default_locale": "en"
}
Your app could require hundreds of modules so for performance and manageability of the manifest, you'll want to create a Dojo build which will reduce the number of js files to one or maybe a couple depending on how you create the build.
I finally managed what I was trying to accomplish. However, I found no way to use the localStorage and to load the classes from a string.
The trick is to load the Dojo class source file from remote using XHR, store it using the Cordova File APIs, getting an URL to the stored file and using this URL in the require().
Does what I want and gives me full control over the cached files.