cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
TimmyBoy
Post Patron
Post Patron

Get base64 from split string

Hello,

How can i get the image from this part?

 

 

Last(
    FirstN(
        Split(
            ThisItem.Result,
            ";"
        ),
        5 //this line contains the base64
    )
).Result

 

 

The image is a Base64 (red dot)

data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4 //8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg==

 

 

 

I used the above code into a image field, but nothing happens?

Thank you

1 ACCEPTED SOLUTION

Accepted Solutions
WarrenBelz
Super User
Super User

Hi @TimmyBoy ,

Try

Substitute(
   Index(
      Split(
         ThisItem.Result,
         ";"
      ),
      5
   ).Result,
   ":",
   ":"
)

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

MVP (Business Applications)   Visit my blog Practical Power Apps

View solution in original post

11 REPLIES 11
WarrenBelz
Super User
Super User

Hi @TimmyBoy ,

Try

Substitute(
   Index(
      Split(
         ThisItem.Result,
         ";"
      ),
      5
   ).Result,
   ":",
   ":"
)

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

MVP (Business Applications)   Visit my blog Practical Power Apps

TimmyBoy
Post Patron
Post Patron

Hello @WarrenBelz 

Weird, no image is loading...

TimmyBoy_0-1674620325463.png

I check the sharepoint list and image field is multi text and plain text...

Hi @TimmyBoy ,

Please see belowBase64Picture.jpg

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

MVP (Business Applications)   Visit my blog Practical Power Apps

TimmyBoy
Post Patron
Post Patron

Hello @WarrenBelz 

I guess we are doing something completely wrong?

TimmyBoy_0-1674622341183.png

Still no image 😞

 

okay, i have added the plain code

TimmyBoy_0-1674622701324.png

But i had to change the : with :

That works, but not into my split code 😞

@TimmyBoy ,

The Substitute will work as well (it does what you have manually) - I think you need a bit of debugging here to work out what text your code outputs.

Bilakanti
Impactful Individual
Impactful Individual

@TimmyBoy what @WarrenBelz  mentioned in the post should work like a charm. Just substitute should work

TimmyBoy
Post Patron
Post Patron

Hello @WarrenBelz and @Bilakanti 

Yeah i think @WarrenBelz has a point

I have to look into it, and i will be back soon 😉 i must be doing something wrong in my split code i guess 😞

Thank you

TimmyBoy
Post Patron
Post Patron

@WarrenBelz 

Weird, nothing helps...

Change the position, remove all other parts so i just keep the base64

But nope

TimmyBoy_0-1674672058270.png

Funny part is if i use your code

TimmyBoy_2-1674672200573.png

The image is loading without troubles...

I really don't get it where it will go wrong 😞

 

@TimmyBoy ,

Have you put both pieces of code as the Default of a couple of Text Boxes, then copied both into Notepad and see if they line up ?

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (2,910)