cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
johnmarlowe
Advocate III
Advocate III

Registering Error when trying to add a flow

Hi 

I'm trying to add a flow into Powerapps and I keep getting a "Registering Error" Message.

When nI try running the flow outside of powerapps, it executes as succesfully and as expected, however I'm frustrated that I keep getting this message when trying to add it in to Powerapps.

 

Has anyone come accross this and knows why this happens?

 

Thanks

Andrew

1 ACCEPTED SOLUTION

Accepted Solutions
v-xida-msft
Community Support
Community Support

Hi @johnmarlowe,

 

Could you please share a bit more about the error message within your app?

Do you mean that you faced this issue when you added a flow into your app?

 

I have made a test on my side and don't have the issue that you mentioned. The user @mokhawaja has faced same issue with you, please check the response within the following thread:

https://powerusers.microsoft.com/t5/General-Discussion/Error-on-adding-a-flow-run-SQL-query-to-power...

 

If you added a "Request - Response" action (use it to return data to your app) within your flow. please check if you have typed proper JSON schema format within the "Request - Response" action. In other words, please check if there are some columns which did not have its type defined within the JSON schema.

 

In addition, please take a try to re-create your flow and then register it within your app again , check if the issue is solved.

 

Best regards,

Kris

 

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

12 REPLIES 12
v-xida-msft
Community Support
Community Support

Hi @johnmarlowe,

 

Could you please share a bit more about the error message within your app?

Do you mean that you faced this issue when you added a flow into your app?

 

I have made a test on my side and don't have the issue that you mentioned. The user @mokhawaja has faced same issue with you, please check the response within the following thread:

https://powerusers.microsoft.com/t5/General-Discussion/Error-on-adding-a-flow-run-SQL-query-to-power...

 

If you added a "Request - Response" action (use it to return data to your app) within your flow. please check if you have typed proper JSON schema format within the "Request - Response" action. In other words, please check if there are some columns which did not have its type defined within the JSON schema.

 

In addition, please take a try to re-create your flow and then register it within your app again , check if the issue is solved.

 

Best regards,

Kris

 

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Many thanks - I'd used the sample payload to create the schema but had neglected to check that all the data types were declared, as per your suggestion. Having done this now it appears to be working and has solved the issue.

 

Thank you

Andrew

tommysantos141
Regular Visitor

In case this helps anyone, I just had that issue pulling data form an external system. I combed through the JSON output field by field and when I use the "Use sample payload to generate schema" option and paste in a sample, the resulting schema doesn't like NULL data values. I made all of those "" and PowerApps took it.

Thanks, simple but effective.

 

Do you have an example? I quite don't understand your solution, but I have the same problem.

Hi, this is how I understood it...

This would register an error...

 

[

      {

        "Id": 29,

        "AccountName": "Account 1",

        "AccountStatus": "Draft",

        "BusinessUnit": null,

        "SFID": "0015E00000mnnnAQAQ",

        "CustID": 1235,

        "Comments": "some text"

      },

      {

        "Id": 30,

        "AccountName": "Account 2",

        "AccountStatus": "Draft",

        "BusinessUnit": null,

        "SFID": "0015E00000mnnmgQAA",

        "CustID": 4563,

        "Comments": "Lorem ipsum dolor sit amet, consectetur adipiscing "

      }
]

 

In the above example, the "Business Unit" field is null in both records. As I understand it Flow doesn't have anything to make a decision on what type of value would be held in the field and throws an error.

 

However, if you pass an empty string or a value Flow can work it out.

 

This works (as the "Business Unit" field is now an empty string (although this would then hold numbers as text in this case))...

[

      {

        "Id": 29,

        "AccountName": "Account 1",

        "AccountStatus": "Draft",

        "BusinessUnit": "",

        "SFID": "0015E00000mnnnAQAQ",

        "CustID": 1235,

        "Comments": "some text"

      },

      {

        "Id": 30,

        "AccountName": "Account 2",

        "AccountStatus": "Draft",

        "BusinessUnit": "",

        "SFID": "0015E00000mnnmgQAA",

        "CustID": 4563,

        "Comments": "Lorem ipsum dolor sit amet, consectetur adipiscing "

      }
]

 

This also works (as there is a value in at least one of the "Busines Unit" fields)...

[

      {

        "Id": 29,

        "AccountName": "Account 1",

        "AccountStatus": "Draft",

        "BusinessUnit": "Management",

        "SFID": "0015E00000mnnnAQAQ",

        "CustID": 1235,

        "Comments": "some text"

      },

      {

        "Id": 30,

        "AccountName": "Account 2",

        "AccountStatus": "Draft",

        "BusinessUnit": null,

        "SFID": "0015E00000mnnmgQAA",

        "CustID": 4563,

        "Comments": "Lorem ipsum dolor sit amet, consectetur adipiscing "

      }
]

 

The other 'trick' I've learnt is to make sure that you have a representative sample to work from, around 10 to 20 records should be okay and ideally, make sure that every cloumn has the correct type of data in it to start with - then you don't get the error in the first place 🙂

 

Cheers

 

 

 

 

 

 

Hi, Gary, how do you change the NULL value to something else when querying an API? The API team believes null is the correct value to pass into json.

Hi

As long as you have defined the field type in Flow as per my earlier example you can pass NULLs without problem - I have various text and numeric fields that pass NULLs quite happily (now the field type is defined).

 

Alternatively, if you want/need to change a NULL value the easiest way is to use a stored proceedure and get the flow to call that instead of the table. I have a number of numeric fields that default to NULL if nothing is entered that cause havoc with the formulas. I use "ISNULL(field_name, replacement_value)" in the stored proceedure SQL Query.

 

As a general rule, I use stored proceedures to carry out the heavy lifting e.g. joining tables, swapping indexes for values, carrying out calculations, etc. Generally much quicker and easier to check and revise - you can also use the stored proceedures in both PowerApps and PowerBI, very useful when running reports.

 

Hope this helps.

NewBee117
Advocate V
Advocate V

If null is not the issue, any chance you could help identify the issue with this schema? Test flow ran fine with correct response results, but PowerApps gives Registering error.

 

{
    "type""object",
    "properties": {
        "data": {
            "type""array",
            "items": {
                "type""object",
                "properties": {
                    "id": {
                        "type""number"
                    },
                    "group_id": {
                        "type": [
                            "number",
                            "null"
                        ]
                    },
                    "returning_visitor_id": {
                        "number": [
                            "string",
                            "null"
                        ]
                    },
                    "name": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "photo_url": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "badge_url": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "status": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "in_datetime": {
                        "type""string"
                    },
                    "out_datetime": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "expected_datetime": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "additional_fields": {
                        "type""object",
                        "properties": {
                            "Email": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            },
                            "Production/Project/Company": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            },
                            "Cell number": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            },
                            "Visiting": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            }
                        }
                    },
                    "personal_fields": {
                        "type": [
                            "object",
                            "null"
                        ]
                    }
                },
                "required": [
                    "id",
                    "group_id",
                    "returning_visitor_id",
                    "name",
                    "photo_url",
                    "badge_url",
                    "status",
                    "in_datetime",
                    "out_datetime",
                    "expected_datetime",
                    "additional_fields",
                    "personal_fields"
                ]
            }
        },
        "links": {
            "type""object",
            "properties": {
                "first": {
                    "type": [
                        "string",
                        "null"
                    ]
                },
                "last": {
                    "type": [
                        "string",
                        "null"
                    ]
                },
                "prev": {
                    "type": [
                        "string",
                        "null"
                    ]
                },
                "next": {
                    "type": [
                        "string",
                        "null"
                    ]
                }
            }
        },
        "meta": {
            "type""object",
            "properties": {
                "current_page": {
                    "type": [
                        "number",
                        "null"
                    ]
                },
                "from": {
                    "type": [
                        "number",
                        "null"
                    ]
                },
                "path": {
                    "type": [
                        "string",
                        "null"
                    ]
                },
                "per_page": {
                    "type": [
                        "number",
                        "null"
                    ]
                },
                "to": {
                    "type": [
                        "number",
                        "null"
                    ]
                }
            }
        }
    }
}

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

Top Solution Authors
Top Kudoed Authors
Users online (57,022)