cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
PVosEska
Level: Powered On

Flow keeps failing, even though completes as expected

Hi Guys,

 

Sorry for the disambigious title first of all.

Second of all, i've been using a flow to update a telephone list through an API call, to update a SP List.

First it makes the call (Returns AD accounts) then parses it, passes it through 3 conditions, and if true, gets a place in the SP list

2019-06-07 09_13_08-Window.png

Now some Phonenumbers don't get through the conditions, as expected. But even though one of the conditions is 'Not equal to Null', it still returns an error that a value is Null but expecting a table or record.

2019-06-07 09_17_30-Window.png

These will not get through the condition (Not as a false condition) but just error and stop there.

I want to send a log of the numbers that don't pass to my Teams, but as they don't get through it, i'm not able to do so. Any ideas how to get rid of this error? Below is the Parsing Schema

{
    "type": "object",
    "properties": {
        "value": {
            "type": "array",
            "items": {
                "type": "object",
                "properties": {
                    "businessPhones": {
                        "type": "array"
                    },
                    "displayName": {
                        "type": "string"
                    },
                    "givenName": {},
                    "jobTitle": {},
                    "mobilePhone": {},
                    "officeLocation": {},
                    "preferredLanguage": {},
                    "surname": {},
                    "userPrincipalName": {
                        "type": "string"
                    },
                    "id": {
                        "type": "string"
                    },
                    "mail": {}
                },
                "required": []
            }
        }
    }
}

Hope you can help!

7 REPLIES 7
Dual Super User
Dual Super User

Re: Flow keeps failing, even though completes as expected

Hi @PVosEska 

 

A few questions: How many accounts are being retrieved? I am guessing that the schema that you have mentioned for the JSON parsing has some issues. I just tested it out with a single set of parameters in it worked fine. If you have multiple users, you can initialise an array variable and then after your http request action, create an apply to each action with the input as the body of the apply to each action. Within the loop, create an action to parse json and get reid of the items and value as these are not getting populated from the response that you are getting. Once you parse the json add another action of append to array variable and populate the array. now come out of the loop and create another apply to each loop and this time use the array that has been populated. 

 

If you could share a screenshot of the data that is coming in (just the headings and how the multiple values are coming arring any sensitive information) I could help you better,

 

Please refer to the screenshot below for a single value: 

 

JSON Schema:

{
    "type": "object",
            "properties": {
                "Name": {
                    "type": "string"
                },
                "Age": {
                    "type": "array"
                }
            },
            "required": []
        }

tsga.png

Hope this Helps!

 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

Dual Super User
Dual Super User

Re: Flow keeps failing, even though completes as expected

@PVosEska 

Here is an example for multiple values:testsyw.png

 

tets11.png

Json Schema:

{
    "type": "object",
    "properties": {
      "Values": {
            "type": "array",
            "items": {
                "type": "object",
                "properties": {
            "Name": {
                "type": "string"
            },
            "Age": {
                "type": "array"
            }
        }
            }
    }
}
}

You can see that I have the Values array noth in source and schema and then I can parse the correct values. 

 

Hope this Helps!

 

PVosEska
Level: Powered On

Re: Flow keeps failing, even though completes as expected

Thanks for your response!

I'll try to implement this in the next couple of days. 

I just ran the HTTP call once and copied the output to the Parse Schema and edited what i had to.

"How many accounts are being retrieved?": About 700-800 Accounts. Of which, about 300 will be actually put in the list.

The businessphones array always has a single value. It's could normally be more than one i guess? That's why it made an array?

 

2019-06-11 09_28_25-Mozilla Firefox.png

 

Dual Super User
Dual Super User

Re: Flow keeps failing, even though completes as expected

HI @PVosEska 

 

Were you able to resolve this? 

zachsi
Level: Powered On

Re: Flow keeps failing, even though completes as expected

Hi @PVosEska,

 

Unlike many programming languages, the expression language Microsoft Flow uses doesn't do short-circuit evaluation on conditions. This means that it's evaluating "null is not equal to null" in parallel with "null does not contain item" and throwing the error on the latter. If you need to ensure that the first one runs first, you'll need to put it in a separate action.

PVosEska
Level: Powered On

Re: Flow keeps failing, even though completes as expected

Okay thanks @zachsi , so creating a condition around/ before the existing one, it should run without errors?

 

Sorry @yashag2255 , i didn't. Very busy week and i'm not sure how to write the parse/compose actions. i have very little knowledge about JSON.

 

Regards,

zachsi
Level: Powered On

Re: Flow keeps failing, even though completes as expected

Correct, you would put the "businessPhones does not contain value" inside the "If yes" branch of "BusinessPhones is not equal to null". Alternatively, you could use the coalesce function on businessPhones before doing the contains check.

Helpful resources

Announcements
firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

firstImage

Incoming: New and improved badges!

We've given our badges an overhaul and also added some brand new ones!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Top Kudoed Authors (Last 30 Days)
Users online (5,193)