Upload Image from Portal and prepare Word document
The Client
A client based in the USA, required a solution for managing media files efficiently. Specifically, they needed to attach multiple images with captions from Dynamics 365 Portal and prepare a Word document (.docx) containing these images and captions. Additionally, the document needed to be uploaded to a designated path on SharePoint.
The Challenge
The client needed to display Accounts, Cases, and Contacts in the PowerApps Portal based on the hierarchy of the logged-in Contact. However, PowerApps Portal properties only provided access to the Parent Account of the logged-in Contact, with no direct method to fetch records according to the entire hierarchy.
The Solution
To address these challenges, we developed a comprehensive solution involving a custom interface and backend processing:
Custom Web Interface:
- Technology Stack: We utilized HTML, jQuery, and Bootstrap to create a user-friendly web template within the Dynamics 365 Portal.
- Functionality: The template allowed users to upload images and provide captions dynamically.
Submit Button and Web API Integration:
- Submit Action: Upon clicking the Submit button, a Web API hosted on Azure was called.
- Data Handling: The API received JSON parameters, including images in binary format and captions as text.
Document Generation and Upload:
- Word Document Creation: The Web API processed the JSON data to generate a Word document (.docx) containing the images and captions.
- SharePoint Upload: The document was then automatically uploaded to the designated path on SharePoint.
Other Features
- Automated Upload: The document is automatically uploaded to a specified SharePoint path upon creation.
- File Naming and Organization: Utilized naming conventions and folder structures to organize the documents effectively.
- Access Control: Configured SharePoint permissions to ensure only authorized users can access or modify the uploaded documents.
- Custom Formatting: Option to define custom styles and formatting for images and captions.
- Table of Contents: Automatically creates a table of contents if the number of images and captions is substantial.
- Metadata: Incorporates metadata such as submission date and user details for better documentation and tracking.
Result
The solution streamlined media management by integrating Dynamics 365 Portal, Azure, and SharePoint, improving efficiency and user experience in handling and documenting media files.