cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Rachel_HH
Frequent Visitor

How to covert "-" to integer

Hi,

My flow run with an error, like pic. i used the formula to covert the date content to specific date format. However, there is "-" in my Statistical Delivery Date data. So this formula did not work to cover “-” string to integer. How can i eidt this formula to have two types of data (date and string) coverted to integer? 

 

formatDateTime(addDays('1900-01-01', add(int(item()?['Statistical Delivery Date']),-2)), 'dd-MMM-yyyy')

 

2022-04-02 11_15_09-Run History _ Power Automate.png2022-04-02 11_16_19-Edit your flow _ Power Automate.png2022-04-02 11_27_04-XLSX File viewer _ Microsoft Teams.png

1 ACCEPTED SOLUTION

Accepted Solutions
abm
Super User
Super User

Hi @Rachel_HH 

 

If you remove the "-"  from Statistical Delivery Date, is that going to work? Then why not use a replace() expression to remove the "-".

 

If that's not going to work could you please post some example Statistical Delivery Dates with "-" and not "-" ones.

 

Thanks

 

 



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blog
Power Automate Video Tutorials

View solution in original post

2 REPLIES 2
abm
Super User
Super User

Hi @Rachel_HH 

 

If you remove the "-"  from Statistical Delivery Date, is that going to work? Then why not use a replace() expression to remove the "-".

 

If that's not going to work could you please post some example Statistical Delivery Dates with "-" and not "-" ones.

 

Thanks

 

 



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blog
Power Automate Video Tutorials
VictorIvanidze
Community Champion
Community Champion

Hi @Rachel_HH,

it seems you do not need to use int() function at all. Try to rewrite your complex function.

--------------------------------------------------------------------------------------
Contact me if you are interested in custom Power Automate development.

Helpful resources

Announcements
 WHAT’S NEXT AT MICROSOFT IGNITE 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Register for a Free Workshop.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

Users online (2,837)