I would like to create the PAD flow, which takes current DateTime, converts it to string in format DDMMYYYY_HHMMSS and creates the folder and file which will be using this string as a suffix eg. folder with name "Data created on 03022021_123821" should be created.
var curDateTime = new Date(); var dateStringArray = ; dateStringArray.push((curDateTime.getDate()<10?"0":"")+curDateTime.getDate()); dateStringArray.push((curDateTime.getMonth()+1<10?"0":"")+(curDateTime.getMonth()+1)); dateStringArray.push("" + curDateTime.getFullYear()); dateStringArray.push("_"); dateStringArray.push((curDateTime.getHours()<10?"0":"")+curDateTime.getHours()); dateStringArray.push((curDateTime.getMinutes()<10?"0":"")+curDateTime.getMinutes()); dateStringArray.push((curDateTime.getSeconds()<10?"0":"")+curDateTime.getSeconds()); var dateString = dateStringArray.join(''); WScript.echo(dateString);
Robin.Core.ActionException: Can't create folder Data created on 03022021 into C:\Users\powerplatform003\Documents\DUMMY_FI Team. ---> System.ArgumentException: Illegal characters in path. at System.IO.Path.CheckInvalidPathChars(String path, Boolean checkAdditional) at System.IO.Path.Combine(String path1, String path2) at Robin.Modules.Folder.Actions.FolderActions.CreateFolder(Variant newFolderPath, Variant newFolderName, Variant& newFolder) --- End of inner exception stack trace --- at Robin.Modules.Folder.Actions.CreateFolder.Execute(ActionContext context) at Robin.Runtime.Engine.ActionRunner.RunAction(String action, Dictionary`2 inputArguments, Dictionary`2 outputArguments, IActionStatement statement)
Did anybody else have simillar situation?
Can you take more screenshots of your detail actions on PAD?
And by the way, why do you need to have the JS script to just convert and format the datetime. You can do that with these simple actions in PAD.
Thanks and hope it can help you.
Did I answer your question? Please consider to Mark my post as a solution! to guide others
THANK YOU! This is the proper answer. Had a very similar issue running Shell script which was returning a file path that I was using in the 'Read text from file' command that would result in the 'illegal character in path' error. Simply trimmed the variable and we are in business. Thank you!
Learn to digitize and optimize business processes and connect all your applications to share data in real time.
Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.
At the monthly call, connect with other leaders and find out how community makes your experience even better.
If you are a small business ISV/Reseller, share your thoughts with our research team.