Unable to save file to SharepointHi all. At the end of what has been (to me) a complex script to extract specific data from an Excel file stored on Sharepoint, then perform necessary analysis, and save as an interactive HTML file, I seem to be struggling with what should be a very basic step. I can no longer see the wood for the trees. Am I missing something here?
This format works for saving to my desktop or any drive on my PC:
myPlatform << Save Interactive HTML( "$DESKTOP/Whole Milk SPC.htm" );
This doesn't work for Saving to Sharepoint:
myPlatform << Save Interactive HTML( "https://dairygoldcloud.sharepoint.com/CI/Whole%20Milk%20SPC.htm" );
Am I missing something obvious? I'm not getting any errors back.
I have write access to the Sharepoint folder and can manually upload the file, but the file just won't save to Sharepoint via JSL script. I'm puzzled. Any help would be appreciated.
ScriptingRe: Unable to save file to SharepointThat URL looks different than what I am used to, below is an example of what works for me. If you manually upload the file can you download or Open() it using JMP?
https://company.sharepoint.com/:x:/r/sites/Site/Shared%20Documents/Folder/Subfolder/File%20name.xlsx
These two links below might help if you are not able to download the file due to permissions issues. You might start by saving the file locally and using Copy Directory() to push it to sharepoint:
https://community.jmp.com/t5/Discussions/Open-microsoft-office-365-cloud-based-excel-from-JMP-JSL/td-p/242367
https://community.jmp.com/t5/Discussions/Open-microsoft-office-365-cloud-based-excel-from-JMP-JSL/m-p/242367#U242367
Re: Unable to save file to SharepointMany thanks for your response (and apologies for my delayed response).
I previously used the links you included to enable me read from Sharepoint. This worked fine.
Tried various combinations of URL, but it's simply not working. In the end, I got IT involved and the workaround is to setup a PowerShell that will automatically transfer the JMP html file to the specified location at predefined times each day. Thanks for your help.
Re: Unable to save file to SharepointI'm glad you found a solution. Note that you can run powershell scripts from within JMP, so you could kick that PS routine using a Run Program() function in your JSL script. Here is an example:
Names Default To Here( 1 );
commands = {
"hostname\!n",
"exit\!n"
};
icommand = 0;
RP = Run Program(
Executable( "PowerShell.exe" ),
ReadFunction( Function( {this}, Write( this << Read ) ) ),
WriteFunction(
Function( {this},
icommand++;
If( icommand <= N Items( commands ),
this << Write( commands[icommand] );
,
this << WriteEOF;
);
)
)
);Re: Unable to save file to SharepointI didn't know (or even consider) that!
Many thanks. Have a great Christmas.
Kieran