Skip to main content

Notifications

Announcements

No record found.

Dynamics 365 Community / Forums / Sales forum / How to find Path/Locat...
Sales forum
Answered

How to find Path/Location of file stored in a table

Posted on by 448

Hi all,

I've a personal table in Dynamics 365 sales, where I store my "opportunities" files.
I need to find the variable PATH of file that I upload on the table and save it on the same row of the file in a specific column.

Thanx for any suggestion.

  • Verified answer
    CRMJetty Profile Picture
    CRMJetty 3,508 on at
    RE: How to find Path/Location of file stored in a table

    Hi DiePic ,

    The CRM Domain is your CRM instance domain which you find from CRM URL and in URL end I have used entity Plural name with account record id in () to access that record related data. please see below example to get more idea.

    Example:
    Here I have attachment field (Datatype is File)in my account entity, now I have attached 1 document for org-2 account record. By hovering on file you will get document download link  which I have highlighted in below screenshot. also you can get link by right click on file name and copy the link.
    pastedimage1662622004612v1.png

    This link is in below format.

    https://<CRM_Domain>/api/data/v9.1/contacts(<contact_id>)/cr947_filecontent/

    Here is the result of file in base64 format which I have uploaded for account:

    pastedimage1662623653099v2.png



    Hope this helps!

    Thanks.

    Please mark as verified if the answer is helpful. Welcome to join hot discussions in Dynamics 365.


  • Suggested answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: How to find Path/Location of file stored in a table

    Hi DiePic,

    Open a record and you can get <CRM_Domain> in the url:

    pastedimage1662620861319v1.png

    There are two part in the "contacts(<contact_id>)".

    First, "contacts" is the plural form of a table logical name.  You can find the logical name here:

    pastedimage1662621131706v2.png

    And the "contact id", you could open the record which you want to get it's file in the "MyDocuments" table( You personal table) and can find it in the url:

    pastedimage1662621302277v3.png

    And the "cr947_filecontent" is the logical name of the file field in your "MyDocuments" table.

  • DiePic Profile Picture
    DiePic 448 on at
    RE: How to find Path/Location of file stored in a table

    Thank you for reply @Maulik Shah

    I'm new in this programs and I've a lot of difficulties to understand. Please can you give me some example?

    https://<CRM_Domain>/api/data/v9.1/contacts(<contact_id>)/cr947_filecontent/$value?size=full

    There is a sure way to obtain this data underlined blue parameters?

  • CRMJetty Profile Picture
    CRMJetty 3,508 on at
    RE: How to find Path/Location of file stored in a table

    Hi DiePic ,

    How you will manage your documents in your custom entity(table)? 

    If you using File DataType field for your custom entity then that field file will b e stored in Azure Blob and you can directly access this file by below format.
    Below is the URL Format to download the file content for a file field for a contact record.
    https://<CRM_Domain>/api/data/v9.1/contacts(<contact_id>)/cr947_filecontent?size=full – This will download the content in base64 format string.
    https://<CRM_Domain>/api/data/v9.1/contacts(<contact_id>)/cr947_filecontent/$value?size=full – This will download the content as byte array.

    Also check below links for File type information:
    https://nishantrana.me/2021/10/01/using-file-and-image-data-type-in-dataverse-dynamics-365/
    https://debajmecrm.com/new-data-type-filein-cds-all-you-may-need-to-know-about-it/

    I hope it helps,

    Thanks.

    Please mark as verified if the answer is helpful. Welcome to join hot discussions in Dynamics 365.

  • DiePic Profile Picture
    DiePic 448 on at
    RE: How to find Path/Location of file stored in a table

    Hi Abdul Wahab,

    thank you for replay ... I'm talking about a personal table "MyDocuments", where I store some file of "opportunities".

    All it's working, but I dont know how find the "path variable" and insert in relative column

  • Suggested answer
    Abdul Wahab Profile Picture
    Abdul Wahab 12,070 Moderator on at
    RE: How to find Path/Location of file stored in a table

    Hi DIE PIC,

    Do you mean share point location? If Yes then Here you are

    1. Open record in a model-driven app. 
    2. Navigate to the documents tab
    3. Select document
    4. Click on the Open Location button

    pastedimage1662533001978v2.png

    If I answer your question then please mark it as verified.

    Let me know if I can provide you with more details.

    Thanks
    Regards,

    Abdul Wahab
    Power Platform/Customer Engagement Developer/Lead/Solution Architecture/Project Manager
    Direct/WhatsApp:+923323281237
    E-mail: abdulwahabubit@outlook.com
    Skype: abdul.wahabubit
    Linkedin: www.linkedin.com/.../

Helpful resources

Quick Links

Dynamics 365 Community Update – Sep 9th

Welcome to the next edition of the Community Platform Update. This is a weekly…

Announcing Our 2024 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,263 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 228,112 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans