Hi Dylan, thanks again for your response. Here’s the objective. Each step in my workflow is described below. However, if you skip to the last step the result is what I’m trying to correct. After your input, I’m hoping that this will let you see what I’m missing and how to show the html file in UI format.
Step 1. Set a trigger in Dropbox to sense a new file in the folder shown below.
Step 2. Retrieve the downloaded contents of a parameter file which shows the path or action that I want to execute if the name of file matches a pattern, and the file extensions match. Step 3. If the file from steps.trigger matches the pattern, then return the path or the html file name
Step 4. If the response to Step 3 is an html file, display html file and end process. If not, the move the file to the appropriate directory.
However, what I’m receiving is the content of the html file, and not the browser execution of it.
Step 1.
steps.trigger
steps.trigger.raw_event{12}
.tag:file
client_modified:2021-06-22T23:38:04Z
content_hash203ef8b7226dbd0287ebc1474145a2aadeab5df0f0e549595c12fd5faf1db350
id:id:D0IfSEO_aWAAAAAAAAACqw
is_downloadable:true
linkhttps://content.dropboxapi.com/apitl/1/xxxxxxxx
name:p.txt
path_display:/ClickUp_WSFolders/Projects/p.txt
path_lower:/clickup_wsfolders/projects/p.txt
rev:5c5634807fda433e41241
server_modified:2021-06-22T23:38:04Z
size:58
Step 2.
steps.dropbox_downloadParamFile
async (steps, events, auths) => {
var x_paramFile = “/WorkFlowApps_ParamFiles/Dropbox_API_ProjectsParams.def”
console.log (“x_paramFile = " + x_paramFile)
const params = {
“arg”: {
“path”: x_paramFile,
}
}
try {
this.resp = await require(”@pipedreamhq/platform").axios(this, {
method: “get”,
url: https://content.dropboxapi.com/2/files/download
,
headers: {
Authorization: Bearer ${auths.dropbox.oauth_access_token}
,
},
params,
})
} catch (err) {
this.err = err
$end(“File not found…”)
}
}
steps.dropbox_downloadParamFile.resp
Dropbox_API_ProjectsParams.def
>> indicates move file to Directory
= indicates output file to *.[ext] (All output files are saved in WorkFlowMasterStartup directory
if output flow is an HTML file open file.
#File: ##-*.txt | /ClickUp_WSFolders**strong text
File: p.txt | /WorkFlowApps_ParamFiles/NewContact_PrepRecord.html
#File: expenses*.xlsx | /CloudmersiveApp
#File: expenses*.csv >> /InvoiceDataFiles
Note: All lines beginning with a # sign and empty lines are ignored. This is essentially my router definition file. I use this same format for each step in the process where I start a new trigger.
Step 3.
steps.nodejs_getRouterFile
I use console.log in order to determine if the code is effective.
a_fileLines[5] = File: p.txt | /WorkFlowApps_ParamFiles/NewContact_PrepRecord.html
x_filePatternExt = txt
x_fileExtension = txt
FileExtension matches router definition…
x_fileBasename = p
No pattern chars # or * exists in file basename…
a_routerSet[0] = | p.txt |
steps.trigger.event.name = p.txt
File Pattern MATCHED…
Note: this is the value returned…
steps.nodejs_getRouterFile.$return_value
/WorkFlowApps_ParamFiles/NewContact_PrepRecord.html
Step 4.
steps.dropbox_downloadHTMLContent
async (steps, events, auths) => {
var x_paramFile = steps.nodejs_getRouterFile.$return_value
console.log (“x_paramFile = " + x_paramFile)
const params = {
“arg”: {
“path”: x_paramFile,
}
}
try {
this.resp = await require(”@pipedreamhq/platform").axios(this, {
method: “get”,
url: https://content.dropboxapi.com/2/files/download
,
headers: {
Authorization: Bearer ${auths.dropbox.oauth_access_token}
,
},
params,
})
} catch (err) {
this.err = err
$end(“File not found…”)
}
}
The Response:
steps.dropbox_downloadHTMLContent.resp
`
This is the Header Section...
Contact Name:
`
this is the sample page of what I want to be displayed that will allow to enter data.
I hope this helps. I’m just not sure what I should be entering in order to open the html file for input.
Thanks,
Scott.
PS. Is there a simplier way that I can copy the steps in my workflow. It seems that if I use Share at the top right of the screen it only shares that particular step in the process?