cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Danilo-ES-BR
Helper I
Helper I

Convert Base64 URL IMG to Store in Library

Hi all! I'm from Brazil and I need a lot of help

 

I'm trying to convert an image I'm using in my application to the image control that comes straight from a URL. However when trying to extract the binary data from it and send it to a flow that composes the binary data and saves it in jpg in my library I noticed the error that the JSON () function is not able to convert. I also tried to generate HTML with this link but without success.

Propery Image in my Image1
"https://barcode.tec-it.com/barcode.ashx?data="&TextInput1.Text&"&code=QRCode&multiplebarcodes=false&..."

where TextInput1.Text is an entry for the user to generate a website's QR Code.

 

After that I store the QR codes inside a collection to call my flow and send it to the library in the SPO

Collect(
col_Imagens;
{
Name: TextInput1.Text,
Value: Substitute(
JSON(
Image1.Image,
JSONFormat.IncludeBinaryData
),
Char(34),
"")})

and finally I call the flow on the send button
'CriarArquivo-Item'.Run(JSON(col_Imagens,JSONFormat.IncludeBinaryData), 1)

attached I put the images of both the power apps and the error of my flow

Error message: It was not possible to process the model's language expressions in the action's' Compose 'entries in line' 1 'and in the' 12454 'column:' The model language function 'dataUriToBinary' expects its parameter to be formatted as a valid data URI. The value provided 'https://barcode.tec-it.com/barcode.ashx?data=Test1&code=QRCode&multiplebarcodes=false&translate-esc=false&unit=Fit&dpi=96&imagetype=Gif&rotation=0&color=%23000000&bgcolor=%23quffiet&mcodepage 0 & eclevel = L 'was not formatted correctly. Check usage details at https://aka.ms/logicexpressions#dataUriToBinary. '.

 

 

I also tried to convert to html but I couldn't
<img src='https://barcode.tec-it.com/barcode.ashx?data="&TextInput1.Text&"&code=QRCode&multiplebarcodes=false&...'>

In summary I need to store this image generated by the url in my library.
Ty!!

 

 
 
 
 
 
1 ACCEPTED SOLUTION

Accepted Solutions
v-bofeng-msft
Community Support
Community Support

Hi @Danilo-ES-BR :

Do you want to save a picture URL as a picture format file and store this file in the SharePoint library?

If so, this is easy to implement, you don’t even need to convert it to JSON. The ‘Up date file from URL’ action in Flow can directly convert URLs to files. I've made a test for your reference:

1\The pic

1.JPG

2\My flow(DaniloFlow)

2.JPG

The formula

DaniloFlow.Run(Image1.Image)

The Rusult:

7.gif

Best Regards,

Bof

View solution in original post

2 REPLIES 2
v-bofeng-msft
Community Support
Community Support

Hi @Danilo-ES-BR :

Do you want to save a picture URL as a picture format file and store this file in the SharePoint library?

If so, this is easy to implement, you don’t even need to convert it to JSON. The ‘Up date file from URL’ action in Flow can directly convert URLs to files. I've made a test for your reference:

1\The pic

1.JPG

2\My flow(DaniloFlow)

2.JPG

The formula

DaniloFlow.Run(Image1.Image)

The Rusult:

7.gif

Best Regards,

Bof

View solution in original post

Danilo-ES-BR
Helper I
Helper I

Ty!!! 😄

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Top Solution Authors
Top Kudoed Authors
Users online (53,995)