Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
krishn
Helper I
Helper I

Object type value conversion to INT

Hi I am getting out put from set activity (integer variable) and I am using the same in if condition activity. However I am getting below error, can please help how to resolve this.

expression I am using @greater(int(activity('Lookup1').output),0) and error I am getting "The function 'int' was invoked with a parameter that is not valid. The value cannot be converted to the target type"

Appreciate for help.

4 REPLIES 4
v-gchenna-msft
Community Support
Community Support

Hi @krishn ,

We haven’t heard from you on the last response and was just checking back to see if you have a resolution yet .
In case if you have any resolution please do share that same with the community as it can be helpful to others .
Otherwise, will respond back with the more details and we will try to help .

Hi @krishn ,

We haven’t heard from you on the last response and was just checking back to see if you have a resolution yet .
In case if you have any resolution please do share that same with the community as it can be helpful to others .
Otherwise, will respond back with the more details and we will try to help .

Ayybee
Regular Visitor

Hi
If firstrow is enabled then you have to use this syntax
@greater(int(activity('LookupActivity').output.firstRow.[name of the attribute you want to compare]),0)
If firstrow is disabled, then you have to use the following:
@greater(int(activity('lookupActivity').output.value[0].[name of the attribute you want to compare]),0)

NandanHegde
Super User
Super User

The outout of this aspect activity('Lookup1').output  is of type object and not integer because of which it is failing.

you need to provide a specific value from that output.

 

Sample :

NandanHegde_0-1712201817099.png

As seen the output of any lookup value is as the above format.

Can you please share the screenshot of the lookup  output value and which value you are trying to convert to Int? Based on that we can help further

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayFBCUpdateCarousel

Fabric Monthly Update - May 2024

Check out the May 2024 Fabric update to learn about new features.