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

Notifications

Announcements

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,187 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
    11,683 Super User 2025 Season 2 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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 503 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 321 Moderator

#3
abm abm Profile Picture

abm abm 237 Most Valuable Professional

Last 30 days Overall leaderboard