web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Unable to create a flo...
Power Automate
Suggested Answer

Unable to create a flow to create a contact from email, when a contact does not exist

(0) ShareShare
ReportReport
Posted on by 2
I am trying to create a Power Automate flow that checks for a contact from all emails and then creates one if it does not exist. 

I seem to be getting an error at this stage of the flow:
 
{
  "type": "If",
  "expression": {
    "and": [
      {
        "equals": [
          "@equals(length(body('Filter_array')), 0)",
          0
        ]
      }
    ]
  },
  "actions": {
    "Create_contact_(V2)": {
      "type": "OpenApiConnection",
      "inputs": {
        "parameters": {
          "folder": "AQMkADMwZjRiMTZmLTc4ZWEtNGQyMC05M2Q1LTY4ZTI5N2VmYjY4NwAuAAAD3MWbPv0Iu0_pNfl_hgA7WQEAUcrfp-hZB0qX0pC_qyj8zQAAAgEOAAAA",
          "item/givenName": "@first(split(triggerBody()?['from']?['emailAddress']?['name'],' '))",
          "item/homePhones": [],
          "item/surname": "@first(split(triggerBody()?['from']?['emailAddress']?['name'],' '))",
          "item/displayName": "@concat(\r\n  last(split(triggerBody()?['from']?['emailAddress']?['name'],' ')),\r\n  ', ',\r\n  first(split(triggerBody()?['from']?['emailAddress']?['name'],' '))\r\n)\r\n",
          "item/emailAddresses": [
            {
              "name": "Work",
              "address": "@triggerBody()?['from']?['emailAddress']?['address']"
            }
          ]
        },
        "host": {
          "apiId": "/providers/Microsoft.PowerApps/apis/shared_office365",
          "connection": "shared_office365",
          "operationId": "ContactPostItem_V2"
        }
      }
    }
  },
  "else": {
    "actions": {}
  },
  "runAfter": {
    "For_each": [
      "Succeeded"
    ]
  }
}
MichaelWeiss_2026...

Your file is currently under scan for potential threats. Please wait while we review it for any viruses or malicious content.

Categories:
I have the same question (0)
  • Dormakaba-WeissMi Profile Picture
    2 on at
    Keep getting this error:

    Flow run failed. Action 'Condition_1' failed: Unable to process template language expressions for action 'Condition_1' at line '0' and column '0': 'The template language function 'length' expects its parameter to be an array or a string. The provided value is of type 'Null'. Please see https://aka.ms/logicexpressions#length for usage details
  • Suggested answer
    Rilsina Pegado Profile Picture
    11 on at
    Hi,
     
    As per the error, it looks like at condition , the input is null while it expects it to be an array or string for the length formula. Can you check the run history to check if the previous action is giving the correct input.
    You can also try to use compose and check if the length formula provides the desired output.
     
    Hope this helps!
    Please accept as solution if it helps.
     
    Thanks.

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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Valantis Profile Picture

Valantis 377

#2
11manish Profile Picture

11manish 279

#3
David_MA Profile Picture

David_MA 234 Super User 2026 Season 1

Last 30 days Overall leaderboard