Quantcast
Channel: Microsoft Dynamics CRM Forum - Recent Threads
Viewing all articles
Browse latest Browse all 82002

javascript attachment

$
0
0

 Ok.  I am trying to have a form on my portal that has 3 text input fields for:   to, subject, body,  and attachment (for an email).

I am trying to send (ajax) these inputs to a power automate flow. 

The text input fields work just fine.   The flow gets them and uses them to create and send an email.

Getting the attachment to the flow has been problematic.

NOTE:  there is no ENTITY involved here.  this is not being done using additional settings.

The attachment input field is of type "file" and it does allow me to choose a file from my local computer using a file selector dialog.

I guess I am missing what to do with the file that is returned from the dialog and how it can be sent to the Flow.

Can anyone understand this?  I definitely need help.

I tried this just to send an attachment to the Flow:

        var secfile = $('#file')[0].files;
        var request = {"url": "https://xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx","method": "POST","timeout": 0,"headers": {"Content-Type": "application/json"
            },"data": secfile,
        };

I have been able to see attibutes of the file, like file.name


Viewing all articles
Browse latest Browse all 82002

Latest Images

Trending Articles



Latest Images