web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Convert string to number
Power Automate
Suggested Answer

Convert string to number

(1) ShareShare
ReportReport
Posted on by 421
Hi everyone, good morning.
 
I am using power automate to list rows from a spreadsheet.  In the spreadsheet, one of the columns is being treated as a text field, however it contains a number.  I have the column type set to number, but flow still treats it as a string.   I have used various methods I have found online to convert to int or float but nothing is working.  Below are some of the ideas I have found.
 
int(trim(first(body('List_rows_present_in_a_table_Seed_Sheet')?['value'])?['DaysSinceLastCreditTran']))
int(item()?['DaysSinceLastCreditTran'])
float(item()?['DaysSinceLastCreditTran'])
 
I have tried in a compose as well as a filter array and am very frustrated at this point.

Any help would be amazing!

Thanks
 
Chris
Categories:
I have the same question (0)
  • ivan_apps Profile Picture
    2,189 Moderator on at
    Can you try breaking down the individual functions in separate compose statements and let us know the results after each step? For example:
     
    body('List_rows_present_in_a_table_Seed_Sheet')?['value']
     
    first(body('List_rows_present_in_a_table_Seed_Sheet')?['value'])
     
    first(body('List_rows_present_in_a_table_Seed_Sheet')?['value'])?['DaysSinceLastCreditTran']
     
    trim(first(body('List_rows_present_in_a_table_Seed_Sheet')?['value'])?['DaysSinceLastCreditTran'])
     
    int(trim(first(body('List_rows_present_in_a_table_Seed_Sheet')?['value'])?['DaysSinceLastCreditTran']))
     
     
    After trim() you should see a string that looks like a number if everything else before that was done correctly.
  • Suggested answer
    Ellis Karim Profile Picture
    12,051 Super User 2026 Season 1 on at
    Hi,
     
    You could convert  DaysSinceLastCreditTran to an integer using the Select action along wiht an expression as shown below:
     
    setProperty(item(),'DaysSinceLastCreditTran', int(item()?['DaysSinceLastCreditTran']))
    Here it is in the new designer:
     
     
    Then use the output of the Select action for the rest of the flow:
     
     
     
     
     
    Ellis
     
     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Vish WR Profile Picture

Vish WR 796

#2
Valantis Profile Picture

Valantis 671

#3
Haque Profile Picture

Haque 551

Last 30 days Overall leaderboard