Skip to main content

Notifications

Power Automate - General Discussion
Unanswered

Compose Error: Unable to process template language expressions in action 'Compose' inputs at line '0' and column '0': 'The template language function 'json' expects its parameter to be a string or an XML. The provided value is of type 'Null'. Please see https://aka.ms/logicexpressions#json for usage

(0) ShareShare
ReportReport
Posted on by 331

Hi Community,

 

I am trying to generate a flow to send an email with an image loaded in a sharepoint column of image type, but the "Compose" step gives me the following error.

 

Francisco77_0-1702478392416.png

 

Does anyone know how it could be solved?.

 

Thanks for youre help¡.

  • Chriddle Profile Picture
    Chriddle 7,371 on at
    Re: Compose Error: Unable to process template language expressions in action 'Compose' inputs at line '0' and column '0': 'The template language function 'json' expects its parameter to be a string or an XML. The provided value is of type 'Null'. Please see https://aka.ms/logicexpressions#json for u

    Check if the expected property Foto1 exists in the output of "Send an HTTP request to Sharepoint".

  • Francisco77 Profile Picture
    Francisco77 331 on at
    Re: Compose Error: Unable to process template language expressions in action 'Compose' inputs at line '0' and column '0': 'The template language function 'json' expects its parameter to be a string or an XML. The provided value is of type 'Null'. Please see https://aka.ms/logicexpressions#json for u

    Hi @Chriddle 

     

    Thanks, it doesn't actually give the error, but I have a question as to why it should return a null value if there is an associated image.

     

    Francisco77_0-1702502609244.png

    And if possible, I would also like to ask you how I can solve the problem that now generates the error in the step that follows the flow (Get File Content Using Path).

     

    Francisco77_1-1702502775076.png

     

     

    Thanks you very much¡

  • Chriddle Profile Picture
    Chriddle 7,371 on at
    Re: Compose Error: Unable to process template language expressions in action 'Compose' inputs at line '0' and column '0': 'The template language function 'json' expects its parameter to be a string or an XML. The provided value is of type 'Null'. Please see https://aka.ms/logicexpressions#json for u

    Either the property Photo returns null or there is no property Photo or the results array is empty or not existent at all.

    Just remove the question marks from your expression and the error message will tell you.

     

    If you don't care what caused the error and just want to get rid of it, you can use:

    json(coalesce(body('Send_an_HTTP_request_to_SharePoint')?['d/results']?[0]?['Foto1'], '{}'))

    This expression returns an empty object if Photo is null.

  • Francisco77 Profile Picture
    Francisco77 331 on at
    Re: Compose Error: Unable to process template language expressions in action 'Compose' inputs at line '0' and column '0': 'The template language function 'json' expects its parameter to be a string or an XML. The provided value is of type 'Null'. Please see https://aka.ms/logicexpressions#json for u

    Hi @abouchaala007 

     

    The expresion I used is: 

     

    json(body('Send_an_HTTP_request_to_SharePoint')?['d/results']?[0]?['Foto1'])
     
    Where Foto1 is the internal name of column.
     
    Francisco77_1-1702480681922.png

     

    Thanks for youre help¡.

     

     

  • Re: Compose Error: Unable to process template language expressions in action 'Compose' inputs at line '0' and column '0': 'The template language function 'json' expects its parameter to be a string or an XML. The provided value is of type 'Null'. Please see https://aka.ms/logicexpressions#json for u

    Hi@Francisco77 , could you provide the expression you are using? 

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,580

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,909

Leaderboard