How can I get the newly created file's ID in the workflow and use it in the same workflow?

Options

Hello, dear team:
I met the use case that I need to create a excel file from a data table, then send the excel file to users.
The issue is the data table is very huge and the output file is over 30 MB which can't be attached in a E-mail.
So I want to insert file's download URL in the mail directly, such as :https://example.pushbot.com/api/files/a526b85f-57a3-4a9a-ad14-8d0dfcedcca3/download
My question is how can I get the file id to paste in the E-mail?
I can't find it from the workflow's any fields.

The support document: How to find a file’s ID doesn't help, it only tells us how to get the file id manually from a completed workflow.
https://help.catalytic.com/docs/data-deletion-save-files/#how-to-find-a-file-s-id
Thank you.

Tagged:

Best Answer

  • Nick_130752
    Nick_130752 Posts: 11
    Answer ✓
    Options

    If you would like to include a link to download a file field in an email, you can reference the file field like a normal field https://help.catalytic.com/docs/reference-fields/ and it will automatically turn into a download link. Please note this only works in email actions.

    For instance, an email built with the body:

    Hello,
    Here is the file: {{My File}}

    will be sent as:

    Hello,
    Here is the file: My File

Answers

  • Ye_939471
    Options

    Hello, dear team:
    I got to know by the action "Text: Remove blank space" can convert the file type field into text type field, and the output is the file's ID.
    Is the action "Text: Remove blank space" the official method to get file ID?
    Do you have other method?
    it is like a workaround.
    Thank you.

  • Jozef_783863
    Jozef_783863 Posts: 331 admin
    Options

    Hi @BIN_127767. In some cases, referencing a file field does output a file ID instead of a file hyperlink. The action "Text: Remove blank space" would be one example of this.

    Can you share why you prefer to use a file ID instead of the file link?

  • Ye_939471
    Options

    Hello @Jozef_783863
    Previously I don't know there is a way to insert file link directly, so I wanted to use file ID to create the file link via format:https://example.pushbot.com/api/files/a526b85f-57a3-4a9a-ad14-8d0dfcedcca3/download.

    Now I don't need to use file id.
    Thank you.