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

Copper Contributor

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.

MdShamimReza_1-1643549515472.png

 

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

MdShamimReza_2-1643549666998.png

 

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

 

 

1 Reply

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""#"
            }
        ]
    }
}