First issue, which you should fix
if(empty(item()?[‘Organization’], null, int(item()?[‘field name’]))
should be
if(empty(item()?[‘Organization’]), null, int(item()?[‘field name’]))
In your flow maybe its correct, but what you typed in or shared is not.
Next.
1. you either have a bad field listed, as in its NOT even there or its not an int compatible value, such as null or blank or its just a string 'Michael' and that cannot be converted to a string
is field name in that instance actually a string, or is it null? if its a string string, you won't fix it as its not compatible to convert, if its just null (empty), then you can just
I wrote this one for you, its long on purpose. Here it is and what it does
You woudl replace my variables('Test') with your fields
1) it checks your Org value is empty and returns null
2) It check if your Field is null (put your item()?['field name'] is null and it returns null if so
3) if your field is NOT null it then checks if it is an int cause otherwise it cannot convert it, if it IT an int, it does the conversion
if its not an int it returns null
if(empty(variables('Test')), null,
if(not(empty(variables('Test2'))),
if(isInt(variables('Test2')),
int(variables('Test')),
null),
null)
)
If these suggestions help resolve your issue, Please consider Marking the answer as such and also maybe a like.
Thank you!
Sincerely, Michael Gernaey