Forum Discussion

krishn's avatar
krishn
Helper I
2 years ago

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

  • 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 :

    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

  • Ayybee's avatar
    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)

  • Anonymous's avatar
    Anonymous
    Not applicable

    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 .

    • Anonymous's avatar
      Anonymous
      Not applicable

      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 .