Opening an HTML file within the workflow

Greetings, I’m new to pipedream. My first step was to have Dropbox event trigger when a new file was created. Now I want to open an HTML file where I can process the information in the file. The html file will be stored in the Dropbox directory. How do access it, and open it? Thanks, Scott.

Hi @sjn001tvh - welcome to the community! When you set up your Dropbox trigger, did you set IncludeLink to true? It looks like it’s set to false by default:

When you set to true and add a file to Dropbox, the event that triggers your Pipedream workflow should then include a URL to get your file (it emits that data at steps.trigger.event.link):

You can then add a step to retrieve the contents – just select the HTTP / Webhook app and the GET Request action. Add {{steps.trigger.event.link}} to the URL field to reference the link emitted by the trigger:

Then click deploy and send a test event – you should see the contents of the file exported from the GET Request step. You can now reference this data in future steps via the steps object:

I hope that helps! Let me know if you have any other questions.

Wow, what a great explanation! Thank you. I’ll give these steps a try today and see how far I can get. Thanks, again. Scott.

I’m not sure I fully explained my objective in this first round of testing. I have created a workflow where I have Dropbox respond when a new file is created as specific folder. The file I create comes from my phone where I share a contact and export the NewContact.vcf file into the Dropbox directory.

I have within that same folder, an html which I want to open and bring in the information from the NewContact.vcf file into the html file for editing. Once complete, then pass it onto another step within the workflow.

At present all I have within the html file is simply a “Hello World” text, that I want to display in order to test how the file is triggered. It’s probably really simply, but I just can’t seem to get over the hurdle of where I need to define the name of the NewContact_PrepRecord.html.

Thanks, Scott.

I’m still having problems trying to grasp the concept. I’ve search other sources and can’t seem to find what I need. The first trigger works great as far as getting the file from the Dropbox api call NewFile. The next step is simply trying to open an html file that informs me that the file has been found and provides me with the name of the file and the fields contained in the file. I can parse the information later as I process edit the information in the html file. I tried looking into npm and other sources. In short how can I trigger an html file that says “Hello World”? Thanks.

I’m sorry to hear you’re having trouble getting this to work. Is the current blocker that you want to load another file from Dropbox (different from the file that triggers your workflow)?

If so, you can try this:

First, add a step to your workflow — select the Dropbox app and then Run Node.js code with Dropbox:

Next, select your connected account (or connect a new account):

Finally, replace the code with the following (I updated the sample code Pipedream scaffolded based on the /download API I found in the Dropbox docs). IMPORTANT: Replace /test/test.htm with the path to your file in Dropbox:

const params = {
  "arg": {
    "path": `/test/test.htm`,
  }
}
return 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,
})

When you run the step, it should return the contents of the file as $return_value for the step:

I hope that helps! Let me know if I misunderstood your question.

Hello. Thanks for your several inputs and code snippets. I have been able to use the Dropbox api calls to listen for a new file, and access the content from the file, and then rename the file with a piece of information from the content. It’s working great.

Scott.

2 Likes

Greetings pravin. I have been able to use Pipedream, and Dropbox, to trigger a process from my phone by creating a text file in one of my folders in Dropbox. I then manipulate the information in the file and create a .csv file. Everything is working great.

The next step I’m struggling with is the trying to move the data in the .csv file to the ClickUp app. I can’t seem to get the auths.clickup.access_token. From the list of apps, I select ClickUp. and select the only option Run Node.js Code with ClickUp. When I deploy this call, I get an error.

I have tried other methods referred from the ClickUp api documentation but I can’t seem to get the integration right, in order to obtain the access token.

Dylan, honored me with the New User of Month designation, and we have been in communication for about a week pertaining to this issue. I was wondering if this is something you also might be able to assist me with as you had previously done.

Though flattered by the designation, my objective is still the same as before: Use my phone to transfer the information about a contact listed in my contact’s list on the phone via share, into ClickUp without having to manually reenter the information as it pertains to that contact. Plus, initiate a project, and set an appointment for that particular client right from one or more of my app on my phone.

I use an app called VoiceNotes that allows me to verbally describe a project, and it immediately transcribes my words into notes (I have an aversion to typing a lot of text into my phone because I despise the idea of using a single finger to type out text – I’m both ancient, and lazy in that area). I can then send that transcription directly to Dropbox, with a set of defined file types. Depending on how I name the files, I can use my own naming conventions for the files to trigger, and then process information into ClickUp.

So getting access to the ClickUp app is the next important step for my custom made project management system.

Here’s the link where I have for Dylan some of the attempts to link with ClickUp and the results of those attempts. If you have a chance to look it over and provide some pointers, I’d really appreciate it.

https://pipedream.com/community/community/t/youre-a-new-user-of-the-month/689?u=sjn001tvh1

Here’s the link to the ClickUp api, where I have been trying to translate those calls to the Pipedream node.js formats.

Thanks,

Scott.

Hi @sjn001tvh - the first thing I noticed is that you referenced auths.clickup.access_token in your post above — is that a typo or the value you’re referencing in your code? The correct reference is auths.clickup.oauth_access_token. Does that resolve the issue for you? If not, did you try running the default code provided when you select Run Node.js with ClickUp without modifying it (and did you connect your ClickUp account to the step first)? I ran a quick test and confirmed that the sample code works for me:

return await require("@pipedreamhq/platform").axios(this, {
  url: `https://api.clickup.com/api/v2/user`,
  headers: {
    "content-type": `application/json`,
    "Authorization": `${auths.clickup.oauth_access_token}`,
  },
})