New SDK Methods for Opening & Uploading Files

:sparkles::sparkles:Hi everyone!

Wanted to quickly jump on and announce our two new monday.execute() methods in our SDK.

What are these new methods?

You now have the ability to open existing files on a board using the monday.execute("openFilesDialog", ...) method.

Additionally, you’re able to trigger a local file upload pop-up window in your app using the monday.execute("triggerFilesUpload", ...) method.

Example app

We created a very simple example app showing you how these two methods will work. Here is what users will see in the UI of this example app:

ezgif.com-gif-maker

We built this example app by modifying the App.js file in our Quickstart React code. Here is a screenshot of our modified file:

You can see that in this example, we inputted the relevant IDs for these two methods manually. You can also, of course, include other SDK methods that will return the relevant IDs, depending on what the user has selected on their boards.

Things to keep in mind

1. The monday.execute("triggerFilesUpload", ...) method will not work in the app preview section. This is something our developers are aware of and are working to address. For now, if you add your view app to an item, board, or dashboard, the feature will work as expected.

2. These methods will not work across boards. You must be sure that the files you are looking to open are located on the board that’s currently open. Same thing applies to uploading a file: the file must be uploaded to the board that’s currently open.

We are so excited for you to start using these methods! Feel free to navigate to our SDK page here for more information. As always, let us know if you have any questions.

Happy building~

Hi I’m trying to upload images using the monday.execute(“triggerFilesUpload”, …) method in my React app. There’s an error prompt

No overload matches this call.
Overload 1 of 3, ‘(type: “openItemCard”, params: { itemId: number; kind?: “updates” | “columns” | undefined; }): Promise’, gave the following error.
Argument of type ‘“triggerFilesUpload”’ is not assignable to parameter of type ‘“openItemCard”’.
Overload 2 of 3, ‘(type: “confirm”, params: { message: string; confirmButton?: string | undefined; cancelButton?: string | undefined; excludeCancelButton?: boolean | undefined; }): Promise’, gave the following error.
Argument of type ‘“triggerFilesUpload”’ is not assignable to parameter of type ‘“confirm”’.
Overload 3 of 3, ‘(type: “notice”, params: { message: string; type?: “success” | “error” | “info” | undefined; timeout?: number | undefined; }): Promise’, gave the following error.
Argument of type ‘“triggerFilesUpload”’ is not assignable to parameter of type ‘“notice”’.ts(2769)

my monday-sdk-js version is 0.1.3. Any support regarding this will be highly appreciated. Thank you.

Hi I’ve been trying to use monday.execute("triggerFilesUpload", ...) method to upload files to a column using my React app. I’m getting this error message though,

No overload matches this call.
Overload 1 of 3, ‘(type: “openItemCard”, params: { itemId: number; kind?: “updates” | “columns” | undefined; }): Promise’, gave the following error.
Argument of type ‘“triggerFilesUpload”’ is not assignable to parameter of type ‘“openItemCard”’.
Overload 2 of 3, ‘(type: “confirm”, params: { message: string; confirmButton?: string | undefined; cancelButton?: string | undefined; excludeCancelButton?: boolean | undefined; }): Promise’, gave the following error.
Argument of type ‘“triggerFilesUpload”’ is not assignable to parameter of type ‘“confirm”’.
Overload 3 of 3, ‘(type: “notice”, params: { message: string; type?: “success” | “error” | “info” | undefined; timeout?: number | undefined; }): Promise’, gave the following error.
Argument of type ‘“triggerFilesUpload”’ is not assignable to parameter of type ‘“notice”’.ts(2769)

my monday-sdk-js version is 0.1.3 . Any support regarding this is highly appreciated. Thank you.

Hello there @chamin_nk,

Matias here!

Would you please send us an email to appsupport@monday.com showing a little bit more of the code you are using so we can take a closer look?

Looking forward to hearing from you :slightly_smiling_face:

Cheers,
Matias

Hi, I’m currently attempting to use monday.execute("triggerFilesUpload", ...) to upload an image to a file column from a board view app that I am building. It works in the browser without issue, but when I attempt to do the same thing from my mobile phone using the Monday.com native app (Android… Galaxy Note 10+), the prompt to upload a file never appears. I am able to upload a file to the column directly from the table view, but not from the custom view that I am building. I suspect it might have something to do with the permissions related to accessing mobile storage/camera from an iframe but I’m not entirely sure. Has anyone else run into this issue and able to provide some guidance? Thanks!

Hello @jmsmit38 and welcome to the community!

I hope you like it here :muscle:

As of today, this is not supported by our app.

Having said that, I will share this feature as a request for our team :slightly_smiling_face:. I will also try to look for a workaround for you. If I find one, I will contact you here!

Let me know if you have any other questions.

Cheers,
Matias

Thanks Matias!

I’ve tried a few different ways to make it work but haven’t spent a lot of time looking for another workaround. Using the standard <input> tag doesn’t seem to work either. To add a little more context, I am using React 16.13.1 … Everything seems to work fine on the desktop, but on mobile the file upload prompt never appears. I’ll look into it more this afternoon as well.

Thanks!
-Jon

1 Like