web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / How to get the uploade...
Power Apps
Unanswered

How to get the uploaded file name and its type from Dataverse?

(0) ShareShare
ReportReport
Posted on by

Hi folks, I am new in Power Apps and can I get a bit of help regarding how to get file names from Dataverse?

 

I have created a table in Power Apps model-driven app -  Dataverse and inside contains an upload file column which allows users to upload files in all kinds of file types (jpg, pdf, etc).

 

3.png

 

I have put the form inside the power pages so that users can register and login,  and upload files accordingly.  

 

I can see and download the files from the customized CRM. and I can get the raw body of the file via  "Download a file or Image"  function in Power Automation.  

11.jpg

 

But I need to get the file name and its file type  (test_img.jpg like listed below in customized CRM ) in string in power automation so that I can use them both in a JSON flow.   Currently,  the file body is just gibberish text without a file name and type. 

 

22.jpg

 

Any help would be highly appreciated, thanks.  

I have the same question (0)
  • Verified answer
    Parvez Ghumra Profile Picture
    1,579 Moderator on at

    @Pistachio2023

     

    You will find that your 'Flexible Funding Form' table will have a custom column for each File Type column you have added. For each record where a file has been uploaded in these columns, a GUID value will be set in this column. You can use this GUID value to retrieve the corresponding file metadata from the fileattachment table, using a FetchXML (or oData via Web API (eg: https://<ENVIRONMENT_URL>/api/data/v9.2/fileattachments?$select=createdon,filename,filesizeinbytes,_objectid_value,objecttypecode,versionnumber,mimetype,msft_datastate,fileattachmentid&$filter=(fileattachmentid eq '<RECORD_GUID>'))) query similar to the following

     

     

    <fetch>
     <entity name="fileattachment">
     <attribute name="createdon" />
     <attribute name="filename" />
     <attribute name="filesizeinbytes" />
     <attribute name="objectid" />
     <attribute name="objecttypecode" />
     <attribute name="versionnumber" />
     <attribute name="mimetype" />
     <attribute name="msft_datastate" />
     <attribute name="fileattachmentid" />
     <filter>
     <condition attribute="fileattachmentid" operator="eq" value="ENTER_GUID" />
     </filter>
     </entity>
    </fetch>

     

     

    You should be able to do the above using the Get Row by ID Dataverse action in Power Automate

     

    The objectid column in this data corresponds to the unique identifier of the record against which the file has been uploaded. So you can use this to retrieve the actual records with their related file attachment metadata

     

    The mimetype column will tell you the file type as a string.

     

    The filename column will tell you the name of the file as a string.

     

    The filesizeinbytes column will tell you the size of the file in bytes as a numeric value (should you need that)

     

  • CU07080733-3 Profile Picture
    on at

    @parvezghumra Thank you so much. This is exactly the solution I've been looking for. My problem has been resolved perfectly. 

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 796 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 327 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard