Microsoft Tech Community is in Read Only mode.  Please enjoy browsing our content while we complete our platform upgrade.

Forum Discussion

Md. Shamim Reza's avatar
Md. Shamim Reza
Copper Contributor
Jan 30, 2022

InvalidTemplate. The template language function 'sub' expects its first parameter to be an integer..

InvalidTemplate. Unable to process template language expressions in action 'Compose_6' inputs at line '0' and column '0': 'The template language function 'sub' expects its first parameter to be an integer or a decimal number. The provided value is of type 'Array'. Please see https://aka.ms/logicexpressions#sub for usage details.'.

 

I have used the below expression in my flow.

 

When I run this flow I am getting an error listed below:

 

I have used the below expressions:

sub(outputs('Compose_5'),outputs('Compose_3'))
sub(int(outputs('Compose_5')),int(outputs('Compose_3')))
sub(outputs('Compose_5'),'Compose_3')
sub(outputs('Compose_5'),2)
sub(int(outputs('Compose_5')),outputs('Compose_3'))
sub(outputs('Compose_5'),int(outputs('Compose_3')))
sub(int('Compose_5'),outputs('Compose_3'))
sub(outputs('Compose_5'),int('Compose_3'))

sub(18,outputs('Compose_3'))     [only this expression working but this is not suitable for me]

 

What is the right expression for me on the Compose 6?

 

Thanks

Shamim

 

 

  • sx5349's avatar
    sx5349
    Copper Contributor

    Hi Md. Shamim Reza 

     

    could you pls help me to find the error in it?

     

    {
        "inputs": {
            "content""@triggerBody()?['data']?['alertContext']?['condition']?['allOf']",
            "schema": [
                {
                    "childErrors": [],
                    "errorType""type",
                    "lineNumber": 0,
                    "linePosition": 0,
                    "message""Invalid type. Expected Object but got Array.",
                    "path""",
                    "schemaId""#"
                }
            ]
        }
    }

Resources