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:
PRODUCES THIS ERROR:
"Found operand types 'Edm.String' and 'Edm.Int32' for operator kind 'Equal'."
...so I converted to int(), which, spoiler alert, produced the exact same error:
And the error:
"Found operand types 'Edm.String' and 'Edm.Int32' for operator kind 'Equal'."
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.
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.