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 / Odata: Convert String ...
Power Automate
Answered

Odata: Convert String to Integer, Integer to String

(0) ShareShare
ReportReport
Posted on by 932

I need to convert a value from string to integer.

 

outputs('C-DatesForYearKey') eq item()?['cr508_yearkey']

 

where outputs('C-DatesForYearKey') is a one data type and item()?['cr508_yearkey']is another

 

Please,

 - how can I convert the string into an integer?

 - how can I convert the integer into a string?

 

This would be a short integer.

 

Thank you for your assistance.

 

(Suuuuuper simple task. Suuuuuper tough to find the answer, either in the docs or on the web)

 

Failed Solution

I really thought I had a workaround by converting the data first in a Compose, where it is posted hot to convert string to int and int to string (int() and string(), conveniently enough; looking at you, OData). But, no. The OData operation seems to convert integers to strings, if they come from certain sources, but not if they come from a List Rows block, like so:

 

CONVERTING TO STRING IN COMPOSE BEFORE COMPARISON:

BenDonahue_0-1635257807230.png

PRODUCES THIS ERROR:

"Found operand types 'Edm.String' and 'Edm.Int32' for operator kind 'Equal'."

BenDonahue_0-1635258185380.png

 

...so I converted to int(), which, spoiler alert, produced the exact same error:

BenDonahue_2-1635257904780.png

And the error:

"Found operand types 'Edm.String' and 'Edm.Int32' for operator kind 'Equal'."

BenDonahue_4-1635257940776.png

 

As OData seems to selectively convert data types, I need an OData command to convert string to int and int to string, which is bizarrely difficult to find/do.

 

Thank you, again, for your assistance. Learning (and posting) this will go a long way to making Power Automate usable for me, and others, I am sure.

 

Categories:
I have the same question (0)
  • Verified answer
    Expiscornovus Profile Picture
    33,851 Most Valuable Professional on at

    Hi @BenDonahue,

     

    It looks like the first part of your Odata filter is a string and the second part is of data type integer.

     

    So, I think your filter expects this:

    cr508_rosterkey eq '10001'

     

    I would convert C-DatesForYearKey to a string and put it between single quote characters in your filter.

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 568

#3
Haque Profile Picture

Haque 538

Last 30 days Overall leaderboard