Convert Dataverse file column content

Convert Dataverse file column content to base 64 format | Power Apps | Canvas Apps

Inhaltsverzeichnis

In this blog, we will show how to convert the value of a Dataverse file column into base format in Power Apps. You only require 3 controls and the JSON function.

If your organization is exploring more advanced automation strategies, leveraging Power Platform Beratungsdienste can help ensure your Canvas Apps solutions are scalable, maintainable, and aligned with business goals.

Ist Ihr Unternehmen bereit für die Automatisierung?

Automatisieren Sie Prozesse mit der Microsoft Power Platform.

Enhance your business efficiency and drive innovation with our Power Platform Beratungsdienste. Our expertise ensures that your Power Apps solutions not only streamline operations but also align with your strategic objectives, empowering your team to focus on impactful projects.

 

Step 1. Add image, button and text controls

In the screen where the base64 format is required, add an image, button and text controls.

Add image, button and text controls Column

Step 2. Set up value for the Image control

Select the image and in the “image” property, add the following formula:

Image Control Column

Last(Table_Attachments).File.Value

Last(Table_Attachments) can be replaced by ThisItem. If the image is in a gallery, or by a variable name that contains the file you want to convert.

Step 3. Set a variable with the base64 content

In the button, add the following code on the OnSelect property:

Set base64 content Column
				
					Set(
    varFiletoBase64,
    JSON(
        Image1.Image,
        JSONFormat.IncludeBinaryData
    )
)

				
			

Step 4. Use the variable

Now the varFiletoBase64 variable contains the representation of the file in base64 format. You can use it in the application as required. 

Sind Sie bereit, die Freude an der Automatisierung zu entdecken?

Ob Sie ein Projekt im Sinn haben oder einfach nur wissen möchten, wie wir Ihnen helfen können, wir freuen uns auf ein Gespräch

For this simple example we are just displaying it in the text control:

Text Control Column

Power Apps allows converting Dataverse files into base64 format by using the JSON PowerFx function in combination with the image control and save this result into a variable that can be used across all the application. Kontaktieren Sie uns if you have any questions or if you’d like some help on Power Apps or PowerFx!

Autor
Power Platform Berater | Experte für Geschäftsprozessautomatisierung
Microsoft Certified Power Platform Berater und Lösungsarchitekt mit über 4 Jahren Erfahrung in der Nutzung von Power Platform, Microsoft 365 und Azure, um kontinuierlich Automatisierungsmöglichkeiten zu entdecken und Prozesse neu zu gestalten.