cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
sdowse
Resolver I
Resolver I

When a HTTP request is received trigger - my flow fails to find the dynamic content as strings are not accepted

Hi All

 

I'm building a flow to accept some json from an external company. My flow is receiving the data but when I try to use the data (for example in a create new record or just a compose action) I get an error saying "......Property selection is not supported on values of type 'String'."

 

Below are the details of my flow and the results of my test.

 

As far as I can see from the web, what I'm doing should work - thanks for your help!

 

THE JSON PAYLOAD

 

json.jpg

THE FLOW DESIGN

 

Flow Design.jpg

 

RESULTS OF THE TEST

Flow Results.jpg

 

Schema (created with a sample payload)

{
    "type""object",
    "properties": {
        "additionalDetails": {
            "type""string"
        },
        "addressLine1": {
            "type""string"
        },
        "addressLine2": {
            "type""string"
        },
        "addressLine3": {},
        "addressLine4": {},
        "bedrooms": {
            "type""integer"
        },
        "cancelled": {},
        "competingCompanies": {
            "type""integer"
        },
        "county": {},
        "createdAt": {
            "type""string"
        },
        "customerName": {
            "type""string"
        },
        "email": {
            "type""string"
        },
        "houseType": {
            "type""string"
        },
        "phone": {
            "type""string"
        },
        "postcode": {
            "type""string"
        },
        "price": {
            "type""integer"
        },
        "propertyType": {
            "type""string"
        },
        "quoteId": {
            "type""string"
        },
        "surveyType": {
            "type""string"
        },
        "town": {
            "type""string"
        }
    }
}
 
1 ACCEPTED SOLUTION

Accepted Solutions
sdowse
Resolver I
Resolver I

Hi @v-siky-msft 

 

I posted quite a long reply to you on Thursday night, but I've just noticed it hasn't appeared on here!! Basically the test data comes from an external company with whom I have an account - I log in to my account on their website and can add my webhook URL and can then send test payloads to the URL direct from their website.

 

Anyway, I've had a play today and have found a workaround that seems to work - instead of trying to use the output of the When a HTTP request is received trigger I have added a Parse JSON action. With some trial and error I wrote a sample JSON to use to generate the schema by removing all the actual data from my test JSON and replacing with with Null - see under the message. I've also copied the schema generated from this sample.

 

I then used a compose action and a CDS create record action to test it and, by using the dynamic content from the Parse JSON action it all worked fine. 

 

I also tried using my sample JSON to create the schema for the When a HTTP request is received trigger - but it still didn't work!

 

Anyway, thanks so much for your time and help, it was very much appreciated.

 

Simon

 

 MY SAMPLE JSON

{"result":{"additionalDetails":null,"addressLine1":null,"addressLine2":null,"addressLine3":null,"addressLine4":null,"bedrooms":null,"cancelled":null,"competingCompanies":null,"county":null,"createdAt":null,"customerName":null,"email":null,"houseType":null,"phone":null,"postcode":null,"price":null,"propertyType":null,"quoteId":null,"surveyType":null,"town":null},"timestamp":null,"token":null,"signature":null}

 

THE RESULTING PARSE JSON SCHEMA

{
    "type""object",
    "properties": {
        "result": {
            "type""object",
            "properties": {
                "additionalDetails": {},
                "addressLine1": {},
                "addressLine2": {},
                "addressLine3": {},
                "addressLine4": {},
                "bedrooms": {},
                "cancelled": {},
                "competingCompanies": {},
                "county": {},
                "createdAt": {},
                "customerName": {},
                "email": {},
                "houseType": {},
                "phone": {},
                "postcode": {},
                "price": {},
                "propertyType": {},
                "quoteId": {},
                "surveyType": {},
                "town": {}
            }
        },
        "timestamp": {},
        "token": {},
        "signature": {}
    }
}
 
THE FLOW
 
It Works.jpg
 
THE RESULTS OF THE COMPOSE ACTION

Additional details: Additional details go here.
123 Test St

 

Test Town
CF11 9HB
Beds: 3
Competing Cos: 0
County: Test County
Created at: 2020-12-09 16:30:32
Name: Test Customer
Email: test@email.com
House type: detached
Phone: 00000111111
Price: £233000
Property Type: house
Quote id: Tes-1607531432
Survey Type: Home Buyer
Timestamp: 1607531432
Token: xxxxxxxxxxxxx
Signature: xxxxxxxxxxxxxxx

View solution in original post

5 REPLIES 5
v-siky-msft
Community Support
Community Support

Hi @sdowse ,

 

The JSON schema is incomplete, the JSON schema lacks the properties of result, timestamp, token and signature.

Please use the whole JSON payload in Notepad to generate the schema.

Snipaste_2020-12-09_14-44-33.png

Another method is to change the customerName expression as follows, but I still suggest you generate a complete JSON schema

triggerBody()['result/customerName']
Hope this helps.
Sik

Hi @v-siky-msft 

 

Thanks so much for your advice - I've re-done the schema (see below the screenshots) but I still get an error message - see screenshots of 2 error messages, one for the original customer name expression and one using your suggested expression. Any ideas what I might be doing wrong?!

Simon

 

Error message with new expression.jpg

 

 

Error message with old expression.jpg

 

{
"type": "object",
"properties": {
"result": {
"type": "object",
"properties": {
"additionalDetails": {
"type": "string"
},
"addressLine1": {
"type": "string"
},
"addressLine2": {
"type": "string"
},
"addressLine3": {
"type": "string"
},
"addressLine4": {
"type": "string"
},
"bedrooms": {
"type": "integer"
},
"cancelled": {
"type": "string"
},
"competingCompanies": {
"type": "integer"
},
"county": {
"type": "string"
},
"createdAt": {
"type": "string"
},
"customerName": {
"type": "string"
},
"email": {
"type": "string"
},
"houseType": {
"type": "string"
},
"phone": {
"type": "string"
},
"postcode": {
"type": "string"
},
"price": {
"type": "integer"
},
"propertyType": {
"type": "string"
},
"quoteId": {
"type": "string"
},
"surveyType": {
"type": "string"
},
"town": {
"type": "string"
}
}
},
"timestamp": {
"type": "integer"
},
"token": {
"type": "string"
},
"signature": {
"type": "string"
}
}
}

v-siky-msft
Community Support
Community Support

Hi @sdowse ,

 

Everything looks great on flow side. How did you call this Post Http Request? What did you input in Request Body?

Please share more details.

Sik

Hi @v-siky-msft 

 

I have an account with a company who send me leads - I log into my account on their website and input the HTTP Post URL that the "When a HTTP request is received" trigger generates.

 

Their website has a test facility so I can get it to send me a test payload of JSON (sorry, I'm not sure what the exact term is!). 

 

The payload arrives at my Flow and I use the first Compose action to show me what is received , which is this: 

 

{"result":{"additionalDetails":"Additional details go here.","addressLine1":"123 Test St","addressLine2":null,"addressLine3":null,"addressLine4":null,"bedrooms":3,"cancelled":null,"competingCompanies":0,"county":"Test County","createdAt":"2020-12-09 16:30:32","customerName":"Test Customer","email":"test@email.com","houseType":"detached","phone":"00000111111","postcode":"CF11 9HB","price":233000,"propertyType":"house","quoteId":"Tes-1607531432","surveyType":"Home Buyer","town":"Test Town"},"timestamp":1607531432,"token":"XXXXXXXXX","signature":"XXXXXXXX"}

 

But.... the first time I did it was a bit different, and this is why my original schema was wrong (as you noticed). I couldn't activate their test functionality without giving them a URL, and I couldn't generate the URL without an example payload - so when the company next sent me a lead via email they attached a file to it which was the JSON payload - except it wasn't exactly the same as that sent by their test - as you noticed!

 

So I then deleted my original trigger and created a new one with the "full" JSON from the test - that gave me a new URL which I updated on the other company's website. I then tried some more tests which is when I got the error messages I attached to my last post. So the data is arriving from the other company but Flow seems to be having an issue dealing with it.

 

I'll post some screenshots of the last failed run (which is where the JSON above came from) below.

 

Thanks again for your help.

 

Simon

 

Top bit of flow.jpgbottom bit of flow.jpg

 

sdowse
Resolver I
Resolver I

Hi @v-siky-msft 

 

I posted quite a long reply to you on Thursday night, but I've just noticed it hasn't appeared on here!! Basically the test data comes from an external company with whom I have an account - I log in to my account on their website and can add my webhook URL and can then send test payloads to the URL direct from their website.

 

Anyway, I've had a play today and have found a workaround that seems to work - instead of trying to use the output of the When a HTTP request is received trigger I have added a Parse JSON action. With some trial and error I wrote a sample JSON to use to generate the schema by removing all the actual data from my test JSON and replacing with with Null - see under the message. I've also copied the schema generated from this sample.

 

I then used a compose action and a CDS create record action to test it and, by using the dynamic content from the Parse JSON action it all worked fine. 

 

I also tried using my sample JSON to create the schema for the When a HTTP request is received trigger - but it still didn't work!

 

Anyway, thanks so much for your time and help, it was very much appreciated.

 

Simon

 

 MY SAMPLE JSON

{"result":{"additionalDetails":null,"addressLine1":null,"addressLine2":null,"addressLine3":null,"addressLine4":null,"bedrooms":null,"cancelled":null,"competingCompanies":null,"county":null,"createdAt":null,"customerName":null,"email":null,"houseType":null,"phone":null,"postcode":null,"price":null,"propertyType":null,"quoteId":null,"surveyType":null,"town":null},"timestamp":null,"token":null,"signature":null}

 

THE RESULTING PARSE JSON SCHEMA

{
    "type""object",
    "properties": {
        "result": {
            "type""object",
            "properties": {
                "additionalDetails": {},
                "addressLine1": {},
                "addressLine2": {},
                "addressLine3": {},
                "addressLine4": {},
                "bedrooms": {},
                "cancelled": {},
                "competingCompanies": {},
                "county": {},
                "createdAt": {},
                "customerName": {},
                "email": {},
                "houseType": {},
                "phone": {},
                "postcode": {},
                "price": {},
                "propertyType": {},
                "quoteId": {},
                "surveyType": {},
                "town": {}
            }
        },
        "timestamp": {},
        "token": {},
        "signature": {}
    }
}
 
THE FLOW
 
It Works.jpg
 
THE RESULTS OF THE COMPOSE ACTION

Additional details: Additional details go here.
123 Test St

 

Test Town
CF11 9HB
Beds: 3
Competing Cos: 0
County: Test County
Created at: 2020-12-09 16:30:32
Name: Test Customer
Email: test@email.com
House type: detached
Phone: 00000111111
Price: £233000
Property Type: house
Quote id: Tes-1607531432
Survey Type: Home Buyer
Timestamp: 1607531432
Token: xxxxxxxxxxxxx
Signature: xxxxxxxxxxxxxxx

View solution in original post

Helpful resources

Announcements
MPA 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

MSFTBizAppsLaunchEvent

Experience what’s next for Power Virtual Agents

See the latest Power Automate innovations, updates, and demos from the Microsoft Business Applications Launch Event.

New Super Users

Meet the Power Automate Super Users!

Many congratulations to the Season 1 2021 Flownaut Crew!

Power Platform ISV STudio

Power Platform ISV Studio

ISV Studio is the go-to Power Platform destination for ISV’s to monitor & manage applications post-AppSource publish.

Users online (60,951)