cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
AdhamFH
Helper V
Helper V

convert string to int

Hello,

 

i have error like this 

error.png

 

 

 

 

 

i have try to convert it to int but i still got an error

error1.png

 

 

 

 

 

 

 

error2.png

what is wrong?

1 ACCEPTED SOLUTION

Accepted Solutions
yashag2255
Dual Super User II
Dual Super User II

Hi @AdhamFH 

 

As I can see in the error message, you actually have an html string and that cannot be converted to an integer. Numbers in a string format can be converted using the int function but you have the string as : 3</p> </body> </html>. Assuming that this is coming from an array variable, here is the expression that you can try: 

 

int(first(split(variables('EmailKonten')[4],'<')))

 

Hope this Helps!

 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

View solution in original post

2 REPLIES 2
yashag2255
Dual Super User II
Dual Super User II

Hi @AdhamFH 

 

As I can see in the error message, you actually have an html string and that cannot be converted to an integer. Numbers in a string format can be converted using the int function but you have the string as : 3</p> </body> </html>. Assuming that this is coming from an array variable, here is the expression that you can try: 

 

int(first(split(variables('EmailKonten')[4],'<')))

 

Hope this Helps!

 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

View solution in original post

@yashag2255 wow it works, thank you 

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Users online (2,745)