1. Creating a File Type Field
· To create a file type field, from your CRM home window, navigate to “Power Automate”.
· Go to Solutions and select your solution to make your customizations.
NOTE: Make sure you are in the right environment as your current CRM’s environment.
· Add a Table (entity) in which you want to add the file type column (field) into it.
· Now click on Add Column to create a field, and give an appropriate name for the field. Also, make sure to select the data-type as “File”.
· Click Done.
2. Adding a Column in the Form
· To add a column in your form to display, navigate to your form from Power Automate.
· And edit your form. And Click on Table Columns.
· Add your newly created field into your form then click Save and Publish.
· Now, you will be able to upload and store a file relating to your entity’s record.
· You can also be able to delete the uploaded file and re-upload another file instead of it.
3. Accessing the File-type column
To access the uploaded file’s content using JavaScript, you can send a request to the following Web API URL:
· To get the file’s content in base64 string, go to:
https://<your-org-url> /api/data/v9.1/<entityname>(<record-GUID>)/<field-schema-name>?size=full
For example,
https://exampleorg.crm.dynamics.com/api/data/v9.1/accounts(aaa19cdd-88df-e311-b8e5-6c3be5a8b200)/new_uploadpdf?size=full
· For simply downloading the file, go to:
https://<your-org-url> /api/data/v9.1/<entityname>(<record-GUID>)/<field-schema-name>/$value
For example,
https://exampleorg.crm.dynamics.com/api/data/v9.1/accounts(aaa19cdd-88df-e311-b8e5-6c3be5a8b200)/new_uploadpdf/$value