cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
CRod
Helper I
Helper I

Parse JSON from Web API Html

Using MS Flows, I am trying to create a list in Sharepoint from an Html list that I downloaded from a Web API. If I download an html with single user, the flow runs correctly. If i download an html with more than one user the flow stops during the Parse JSON step with the following error.  

 

 

[
  {
    "message": "Invalid type. Expected Object but got Array.",
    "lineNumber": 0,
    "linePosition": 0,
    "path": "PublicEmployeeResponse.Data.d2p1:PublicEmployee",
    "schemaId": "#/properties/PublicEmployeeResponse/properties/Data/properties/d2p1:PublicEmployee",
    "errorType": "type",
    "childErrors": []
  }
]​<p> </p><p>This is the schema I have that works with a single user. <li-code lang="markup">{
    "type": "object",
    "properties": {
        "PublicEmployeeResponse": {
            "type": "object",
            "properties": {
                "@@xmlns:i": {
                    "type": "string"
                },
                "@@xmlns": {
                    "type": "string"
                },
                "Count": {
                    "type": "string"
                },
                "Data": {
                    "type": "object",
                    "properties": {
                        "@@xmlns:d2p1": {
                            "type": "string"
                        },
                        "d2p1:PublicEmployee": {
                            "type": "object",
                            "properties": {
                                "d2p1:AgencyCode": {
                                    "type": "string"
                                },
                                "d2p1:AlternativeFirstName": {
                                    "type": "object",
                                    "properties": {
                                        "@@i:nil": {
                                            "type": "string"
                                        }
                                    }
                                },
                                "d2p1:EmployeeType": {
                                    "type": "string"
                                },
                                "d2p1:FirstName": {
                                    "type": "string"
                                },
                                "d2p1:FormattedSupervisorName": {
                                    "type": "string"
                                },
                                "d2p1:Grade": {
                                    "type": "string"
                                },
                                "d2p1:Id": {
                                    "type": "string"
                                },
                                "d2p1:IsActive": {
                                    "type": "string"
                                },
                                "d2p1:LastName": {
                                    "type": "string"
                                },
                                "d2p1:Location": {
                                    "type": "string"
                                },
                                "d2p1:LocationId": {
                                    "type": "string"
                                },
                                "d2p1:MiddleName": {
                                    "type": "string"
                                },
                                "d2p1:MobilePhone": {
                                    "type": "string"
                                },
                                "d2p1:MobilePhoneFormatted": {
                                    "type": "string"
                                },
                                "d2p1:MobilePhoneIsForeign": {
                                    "type": "string"
                                },
                                "d2p1:Office": {
                                    "type": "string"
                                },
                                "d2p1:OfficePhone": {
                                    "type": "string"
                                },
                                "d2p1:OfficePhoneFormatted": {
                                    "type": "string"
                                },
                                "d2p1:OfficePhoneIsForeign": {
                                    "type": "string"
                                },
                                "d2p1:OfficialEmail": {
                                    "type": "string"
                                },
                                "d2p1:OrgCode": {
                                    "type": "string"
                                },
                                "d2p1:OrgName": {
                                    "type": "string"
                                },
                                "d2p1:Series": {
                                    "type": "string"
                                },
                                "d2p1:Step": {
                                    "type": "string"
                                },
                                "d2p1:StreetAddress": {
                                    "type": "string"
                                },
                                "d2p1:SupervisorAlternativeFirstName": {
                                    "type": "object",
                                    "properties": {
                                        "@@i:nil": {
                                            "type": "string"
                                        }
                                    }
                                },
                                "d2p1:SupervisorEmail": {
                                    "type": "string"
                                },
                                "d2p1:SupervisorEmployeeType": {
                                    "type": "string"
                                },
                                "d2p1:SupervisorFirstName": {
                                    "type": "string"
                                },
                                "d2p1:SupervisorId": {
                                    "type": "string"
                                },
                                "d2p1:SupervisorLastName": {
                                    "type": "string"
                                },
                                "d2p1:SupervisorMiddleName": {
                                    "type": "string"
                                },
                                "d2p1:SupervisorMobilePhone": {
                                    "type": "string"
                                },
                                "d2p1:SupervisorMobilePhoneFormatted": {
                                    "type": "object",
                                    "properties": {
                                        "@@i:nil": {
                                            "type": "string"
                                        }
                                    }
                                },
                                "d2p1:SupervisorMobilePhoneIsForeign": {
                                    "type": "string"
                                },
                                "d2p1:SupervisorOfficialPhone": {
                                    "type": "string"
                                },
                                "d2p1:SupervisorOfficialPhoneFormatted": {
                                    "type": "object",
                                    "properties": {
                                        "@@i:nil": {
                                            "type": "string"
                                        }
                                    }
                                },
                                "d2p1:SupervisorOfficialPhoneIsForeign": {
                                    "type": "string"
                                },
                                "d2p1:SupervisorTitle": {
                                    "type": "string"
                                },
                                "d2p1:Title": {
                                    "type": "string"
                                },
                                "d2p1:UserPrincipalName": {
                                    "type": "string"
                                }
                            }
                        }
                    }
                },
                "Message": {
                    "type": "object",
                    "properties": {
                        "@@i:nil": {
                            "type": "string"
                        }
                    }
                },
                "Total": {
                    "type": "string"
                }
            }
        }
    }
}

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
27 REPLIES 27
grantjenkins
Super User
Super User

Are you able to send through the schema output from multiple users to see the difference.

 

Assuming a single user will just return a single object for that user, and multiple users will include each user object inside an array for the users. So just need to see the difference and workout how to structure the flow to get around it.


----------------------------------------------------------------------
If I've answered your question, please mark the post as Solved.
If you like my response, please consider giving it a Thumbs Up.

If i get the download for a single user and create the schema from it works fine (Creating the schema from json on previous step).  But if i get the download from multiple users and create the schema, it does not work for single or multiple users. What I did notice is that the json created with a single user it has that classic look to it, but with the multiple users it creates something similar to the one attached.  

 

{"statusCode":200,"headers":{"Transfer-Encoding":"chunked","Vary":"Accept-Encoding","Access-Control-Allow-Headers":"Origin, X-Requested-With, Authorization","Access-Control-Allow-Origin":"*","Access-Control-Allow-Credentials":"true","ms-correlation-x":"8edfe7c1-fb0e-49d4-a90f-13917862d52b","OData-Version":"4.0","Access-Control-Expose-Headers":"Date, Content-Length, Server, OData-Version,ms-correlation-x","request-id":"d81f36c6-b768-4a55-9dad-680f70858533","x-content-type-options":"nosniff","Strict-Transport-Security":"max-age=31536000; includeSubDomains","Date":"Sat, 19 Mar 2022 03:06:57 GMT","Server":"Microsoft-HTTPAPI/2.0","Content-Type":"application/json; odata.metadata=minimal; odata.streaming=true","Content-Length":"1099344"},"body":{"@odata.context":"https://api.businesscentral.dynamics.com/v2.0/2efefwefdfe9-848wef37712fwef6323/Production/ODataV4/$metadata#Company('Company')/CustomerCard","value":[{"@odata.etag":"W/\"JzQ0OzI0a1gxU3hNSmY5RVVuSHpqK0oxSm9mM2lxZUkrL1NPVndwWUE3QmRpY1E9MTswMDsn\"","No":"16997","Name":"Microsoft","Name_2":"","Search_Name":"Microsoft","IC_Partner_Code":"","Balance_LCY":0,"Balance_Due_LCY":0,"Credit_Limit_LCY":0,"Blocked":" ","Privacy_Blocked":false,"Salesperson_Code":"","Responsibility_Center":"","Service_Zone_Code":"","Document_Sending_Profile":"","TotalSales2":0,"CustSalesLCY_CustProfit_AdjmtCostLCY":0,"AdjCustProfit":0,"AdjProfitPct":0,"CFDI_Purpose":"","CFDI_Relation":"","CFDI_Export_Code":"","SAT_Tax_Regime_Classification":"","Last_Date_Modified":"2022-02-17","Disable_Search_by_Name":false,"WSI_Square_Footage":"","WSI_Contract_End_Date":"0001-01-01","WSI_County":"Palm Beach","WSI_Epay_ID":"0","Address":"3923 Technology Way","Address_2":"Suite 640","Country_Region_Code":"US","City":"Boca Raton","County":"FL","Post_Code":"33431","ShowMap":"Show on Map","Phone_No":"(561) 756-9047","MobilePhoneNo":"","E_Mail":"","Fax_No":"","Home_Page":"","Language_Code":"","Primary_Contact_No":"","ContactName":"","Bill_to_Customer_No":"","VAT_Registration_No":"","EORI_Number":"","GLN":"","Use_GLN_in_Electronic_Document":false,"Copy_Sell_to_Addr_to_Qte_From":"Company","Tax_Liable":true,"Tax_Area_Code":"EXEMPT","Tax_Identification_Type":"Legal Entity","Tax_Exemption_No":"","RFC_No":"","CURP_No":"","State_Inscription":"","Gen_Bus_Posting_Group":"","VAT_Bus_Posting_Group":"","Customer_Posting_Group":"DEFAULT","Currency_Code":"","Price_Calculation_Method":" ","Customer_Price_Group":"","Customer_Disc_Group":"","Allow_Line_Disc":true,"Invoice_Disc_Code":"","Prices_Including_VAT":false,"Prepayment_Percent":0,"Application_Method":"Manual","Partner_Type":" ","Payment_Terms_Code":"DOR","Payment_Method_Code":"CHEQUE","Reminder_Terms_Code":"","Fin_Charge_Terms_Code":"","Cash_Flow_Payment_Terms_Code":"","Print_Statements":false,"Last_Statement_No":0,"Block_Payment_Tolerance":false,"Preferred_Bank_Account_Code":"","Bank_Communication":"E English","Check_Date_Format":" ","Check_Date_Separator":" ","Ship_to_Code":"SHIP TO","Location_Code":"","Combine_Shipments":false,"Reserve":"Optional","Shipping_Advice":"Partial","Shipment_Method_Code":"","Shipping_Agent_Code":"","Shipping_Agent_Service_Code":"","Shipping_Time":"","Base_Calendar_Code":"","Customized_Calendar":"No","ExpectedCustMoneyOwed":0,"TotalMoneyOwed":0,"CalcCreditLimitLCYExpendedPct":0,"Balance_Due":0,"Payments_LCY":0,"CustomerMgt_AvgDaysToPay_No":0,"DaysPaidPastDueDate":0,"AmountOnPostedInvoices":0,"AmountOnCrMemo":0,"AmountOnOutstandingInvoices":0,"AmountOnOutstandingCrMemos":0,"CustInvDiscAmountLCY":0,"Global_Dimension_1_Filter":"","Global_Dimension_2_Filter":"","Currency_Filter":"","Date_Filter":"''..03/19/22"},{"@odata.etag":"W/\"JzQ0O1lvYnJsb1BxeDMwTHFLV3FxUTBMTit4cUdOcmVpakZZSlZmQ3V6c0xCTnc9MTswMDsn\"","No":"19645","Name":"Banfield, The Pet Hospital","Name_2":"","Search_Name":"BANFIELD, THE PET HOSPITAL","IC_Partner_Code":"","Balance_LCY":0,"Balance_Due_LCY":0,"Credit_Limit_LCY":0,"Blocked":"All","Privacy_Blocked":false,"Salesperson_Code":"","Responsibility_Center":"","Service_Zone_Code":"","Document_Sending_Profile":"","TotalSales2":0,"CustSalesLCY_CustProfit_AdjmtCostLCY":0,"AdjCustProfit":0,"AdjProfitPct":0,"CFDI_Purpose":"","CFDI_Relation":"","CFDI_Export_Code":"","SAT_Tax_Regime_Classification":"","Last_Date_Modified":"2022-02-17","Disable_Search_by_Name":false,"WSI_Square_Footage":"","WSI_Contract_End_Date":"0001-01-01","WSI_County":"Multnomah","WSI_Epay_ID":"0","Address":"8000 NE Tillamook St","Address_2":"","Country_Region_Code":"US","City":"Portland","County":"OR","Post_Code":"97213","ShowMap":"Show on Map","Phone_No":"","MobilePhoneNo":"","E_Mail":"","Fax_No":"","Home_Page":"","Language_Code":"","Primary_Contact_No":"","ContactName":"","Bill_to_Customer_No":"","VAT_Registration_No":"","EORI_Number":"","GLN":"","Use_GLN_in_Electronic_Document":false,"Copy_Sell_to_Addr_to_Qte_From":"Company","Tax_Liable":true,"Tax_Area_Code":"EXEMPT","Tax_Identification_Type":"Legal Entity","Tax_Exemption_No":"","RFC_No":"","CURP_No":"","State_Inscription":"","Gen_Bus_Posting_Group":"","VAT_Bus_Posting_Group":"","Customer_Posting_Group":"DEFAULT","Currency_Code":"","Price_Calculation_Method":" ","Customer_Price_Group":"","Customer_Disc_Group":"","Allow_Line_Disc":true,"Invoice_Disc_Code":"","Prices_Including_VAT":false,"Prepayment_Percent":0,"Application_Method":"Manual","Partner_Type":" ","Payment_Terms_Code":"DOR","Payment_Method_Code":"CHEQUE","Reminder_Terms_Code":"","Fin_Charge_Terms_Code":"","Cash_Flow_Payment_Terms_Code":"","Print_Statements":false,"Last_Statement_No":0,"Block_Payment_Tolerance":false,"Preferred_Bank_Account_Code":"","Bank_Communication":"E English","Check_Date_Format":" ","Check_Date_Separator":" ","Ship_to_Code":"SHIP TO","Location_Code":"","Combine_Shipments":false,"Reserve":"Optional","Shipping_Advice":"Partial","Shipment_Method_Code":"","Shipping_Agent_Code":"","Shipping_Agent_Service_Code":"","Shipping_Time":"","Base_Calendar_Code":"","Customized_Calendar":"No","ExpectedCustMoneyOwed":0,"TotalMoneyOwed":0,"CalcCreditLimitLCYExpendedPct":0,"Balance_Due":0,"Payments_LCY":0,"CustomerMgt_AvgDaysToPay_No":0,"DaysPaidPastDueDate":0,"AmountOnPostedInvoices":0,"AmountOnCrMemo":0,"AmountOnOutstandingInvoices":0,"AmountOnOutstandingCrMemos":0,"CustInvDiscAmountLCY":0,"Global_Dimension_1_Filter":"","Global_Dimension_2_Filter":"","Currency_Filter":"","Date_Filter":"''..03/19/22"},{"@odata.etag":"W/\"JzQ0O1VwNXp6dmZHYndSTWd0elgzQWZNUTZtb3lKdmpDZVkvZFpRbXBhL0tHSEU9MTswMDsn\"","No":"19655","Name":"Butters Realty & Management","Name_2":"","Search_Name":"BUTTERS REALTY & MANAGEMENT","IC_Partner_Code":"","Balance_LCY":0,"Balance_Due_LCY":0,"Credit_Limit_LCY":0,"Blocked":" ","Privacy_Blocked":false,"Salesperson_Code":"","Responsibility_Center":"","Service_Zone_Code":"","Document_Sending_Profile":"","TotalSales2":0,"CustSalesLCY_CustProfit_AdjmtCostLCY":0,"AdjCustProfit":0,"AdjProfitPct":0,"CFDI_Purpose":"","CFDI_Relation":"","CFDI_Export_Code":"","SAT_Tax_Regime_Classification":"","Last_Date_Modified":"2022-02-17","Disable_Search_by_Name":false,"WSI_Square_Footage":"","WSI_Contract_End_Date":"0001-01-01","WSI_County":"Broward","WSI_Epay_ID":"0","Address":"6820 Lyons Technology Circle, Suite 100","Address_2":"","Country_Region_Code":"US","City":"Coconut Creek","County":"FL","Post_Code":"33073","ShowMap":"Show on Map","Phone_No":"","MobilePhoneNo":"","E_Mail":"","Fax_No":"","Home_Page":"","Language_Code":"","Primary_Contact_No":"","ContactName":"","Bill_to_Customer_No":"19655","VAT_Registration_No":"","EORI_Number":"","GLN":"","Use_GLN_in_Electronic_Document":false,"Copy_Sell_to_Addr_to_Qte_From":"Company","Tax_Liable":true,"Tax_Area_Code":"EXEMPT","Tax_Identification_Type":"Legal Entity","Tax_Exemption_No":"","RFC_No":"","CURP_No":"","State_Inscription":"","Gen_Bus_Posting_Group":"","VAT_Bus_Posting_Group":"","Customer_Posting_Group":"DEFAULT","Currency_Code":"","Price_Calculation_Method":" ","Customer_Price_Group":"","Customer_Disc_Group":"","Allow_Line_Disc":true,"Invoice_Disc_Code":"","Prices_Including_VAT":false,"Prepayment_Percent":0,"Application_Method":"Manual","Partner_Type":" ","Payment_Terms_Code":"DOR","Payment_Method_Code":"CHEQUE","Reminder_Terms_Code":"","Fin_Charge_Terms_Code":"","Cash_Flow_Payment_Terms_Code":"","Print_Statements":false,"Last_Statement_No":0,"Block_Payment_Tolerance":false,"Preferred_Bank_Account_Code":"","Bank_Communication":"E English","Check_Date_Format":" ","Check_Date_Separator":" ","Ship_to_Code":"SHIP TO","Location_Code":"","Combine_Shipments":false,"Reserve":"Optional","Shipping_Advice":"Partial","Shipment_Method_Code":"","Shipping_Agent_Code":"","Shipping_Agent_Service_Code":"","Shipping_Time":"","Base_Calendar_Code":"","Customized_Calendar":"No","ExpectedCustMoneyOwed":0,"TotalMoneyOwed":0,"CalcCreditLimitLCYExpendedPct":0,"Balance_Due":0,"Payments_LCY":0,"CustomerMgt_AvgDaysToPay_No":0,"DaysPaidPastDueDate":0,"AmountOnPostedInvoices":0,"AmountOnCrMemo":0,"AmountOnOutstandingInvoices":0,"AmountOnOutstandingCrMemos":0,"CustInvDiscAmountLCY":0,"Global_Dimension_1_Filter":"","Global_Dimension_2_Filter":"","Currency_Filter":"","Date_Filter":"''..03/19/22"}]}}

I am progressing but have not solved the issue. So the reason it worked with one is because the schema was set to object. When i created the schema with multiple users, I thought it was giving me errors due to the null values but I was wrong. I already tried using the ["string","null"] option but it didn't solve the issue.

 

 This is the error result i keep getting.

 

{"errors":[{"message":"Invalid type. Expected String but got Object.","lineNumber":0,"linePosition":0,"path":"PublicEmployeeResponse.Data.d2p1:PublicEmployee[1].d2p1:SupervisorAlternativeFirstName","schemaId":"#/properties/PublicEmployeeResponse/properties/Data/properties/d2p1:PublicEmployee/items/properties/d2p1:SupervisorAlternativeFirstName","errorType":"type","childErrors":[]},

I think the issue is coming from this part of the schema but i have tried multiple variations but i cant figure it out. 

 },
                  "d2p1:AlternativeFirstName": {
                    "type": "object",
                    "properties": {
                      "@@i:nil": {
                        "type": "string"
                      }
                    }
                  },

 

Not sure if im getting closer but I did start getting dynamic contents with the parse JSON. However, they are not the ones i need. I took the scheme to a json viewer and this is what i see.  The items under properties are the itmes i get unter the dynamic contents. 

	
	object		{2}
		
type	:	object
		
	properties		{1}
		
	PublicEmployeeResponse		{2}
		
type	:	object
		
	properties		{4}
		
	@@xmlns:i		{1}
		
	@@xmlns		{1}
		
	Count		{1}
		
	Data		{4}

 

The items I need are embedded a little further down and im lost on how to get to them. The array i need is located under a different property section. (The properties under Public Employee with {41})

 

	
	object		{2}
		
type	:	object
		
	properties		{1}
		
	PublicEmployeeResponse		{2}
		
type	:	object
		
	properties		{4}
		
	@@xmlns:i		{1}
		
	@@xmlns		{1}
		
	Count		{1}
		
	Data		{4}
		
type	:	object
		
	properties		{1}
		
	@@xmlns:d2p1		{2}
		
type	:	string
		
	d2p1:PublicEmployee		{2}
		
type	:	array
		
	items		{3}
		
type	:	object
		
	properties		{41}
		
	required		[41]
		
	Message		{1}
		
	Total		{1}

 

 

grantjenkins
Super User
Super User

Just confirming - have you got this sorted now? Sorry been away for the last few days and no time to get back to some of these questions. Let me know if you still need help.


----------------------------------------------------------------------
If I've answered your question, please mark the post as Solved.
If you like my response, please consider giving it a Thumbs Up.

Thanks for the reply. I thought I had figured it out but nope 😔. I got all excited because i got the dynamic content variables to show up following that tutorial. But once i got to the create item i got another error. I grabbed a variable from the newly created dynamic content and it added an extra step automatically, apply to each. Im not sure if thats the way it should be. But its getting me null errors again. Im starting back to see if i can narrow down what im doing wrong. 

CRod
Helper I
Helper I

😮I saw the first glimpse of success. I started again from scratch. When I create the schema from the compose (previous step) I get several errors on the output. Most are saying something like "expected object but received string". Somewhere i fount that if you replace it with "string","null". It takes care of the issue. So i did. But instead of doing all at once, i ran it multiple times. So, Im not getting all the varialbes i need yet but i got more. So, im on the right path. I did see that i do need the "apply to each" step. Hope, im making sence. dynamic contents.JPGNew Test.JPG

 

 

 

 

{
    "type": "object",
    "properties": {
        "PublicEmployeeResponse": {
            "type": "object",
            "properties": {
                "@@xmlns:i": {
                    "type": "string"
                },
                "@@xmlns": {
                    "type": "string"
                },
                "Count": {
                    "type": "string"
                },
                "Data": {
                    "type": "object",
                    "properties": {
                        "@@xmlns:d2p1": {
                            "type": "string"
                        },
                        "d2p1:PublicEmployee": {
                            "type": "array",
                            "items": {
                                "type": "object",
                                "properties": {
                                    "d2p1:AgencyCode": {
                                        "type": [
                                            "string",
                                            "object",
                                            "null"
                                        ]
                                    },
                                    "d2p1:AlternativeFirstName": {
                                        "type": [
                                            "object",
                                            "string"
                                        ],
                                        "properties": {
                                            "@@i:nil": {
                                                "type": [
                                                    "string",
                                                    "object",
                                                    "null"
                                                ]
                                            }
                                        }
                                    },
                                    "d2p1:EmployeeType": {
                                        "type": [
                                            "string",
                                            "object",
                                            "null"
                                        ]
                                    },
                                    "d2p1:FirstName": {
                                        "type": [
                                            "string",
                                            "object",
                                            "null"
                                        ]
                                    },
                                    "d2p1:FormattedSupervisorName": {
                                        "type": [
                                            "string",
                                            "object",
                                            "null"
                                        ]
                                    },
                                    "d2p1:Grade": {
                                        "type": [
                                            "string",
                                            "object",
                                            "null"
                                        ]
                                    },
                                    "d2p1:Id": {
                                        "type": [
                                            "string",
                                            "object",
                                            "null"
                                        ]
                                    },
                                    "d2p1:IsActive": {
                                        "type": [
                                            "string",
                                            "object",
                                            "null"
                                        ]
                                    },
                                    "d2p1:LastName": {
                                        "type": [
                                            "string",
                                            "object",
                                            "null"
                                        ]
                                    },
                                    "d2p1:Location": {
                                        "type": [
                                            "string",
                                            "object",
                                            "null"
                                        ]
                                    },
                                    "d2p1:LocationId": {
                                        "type": [
                                            "string",
                                            "object",
                                            "null"
                                        ]
                                    },
                                    "d2p1:MiddleName": {
                                        "type": [
                                            "string",
                                            "object",
                                            "null"
                                        ]
                                    },
                                    "d2p1:MobilePhone": {
                                        "type": [
                                            "string",
                                            "object",
                                            "null"
                                        ]
                                    },
                                    "d2p1:MobilePhoneFormatted": {
                                        "type": [
                                            "string",
                                            "object",
                                            "null"
                                        ]
                                    },
                                    "d2p1:MobilePhoneIsForeign": {
                                        "type": [
                                            "string",
                                            "object",
                                            "null"
                                        ]
                                    },
                                    "d2p1:Office": {
                                        "type": [
                                            "string",
                                            "object",
                                            "null"
                                        ]
                                    },
                                    "d2p1:OfficePhone": {
                                        "type": [
                                            "string",
                                            "object",
                                            "null"
                                        ]
                                    },
                                    "d2p1:OfficePhoneFormatted": {
                                        "type": [
                                            "string",
                                            "object",
                                            "null"
                                        ]
                                    },
                                    "d2p1:OfficePhoneIsForeign": {
                                        "type": [
                                            "string",
                                            "object",
                                            "null"
                                        ]
                                    },
                                    "d2p1:OfficialEmail": {
                                        "type": [
                                            "string",
                                            "object",
                                            "null"
                                        ]
                                    },
                                    "d2p1:OrgCode": {
                                        "type": [
                                            "string",
                                            "object",
                                            "null"
                                        ]
                                    },
                                    "d2p1:OrgName": {
                                        "type": [
                                            "string",
                                            "object",
                                            "null"
                                        ]
                                    },
                                    "d2p1:Series": {
                                        "type": [
                                            "string",
                                            "object",
                                            "null"
                                        ]
                                    },
                                    "d2p1:Step": {
                                        "type": [
                                            "string",
                                            "object",
                                            "null"
                                        ]
                                    },
                                    "d2p1:StreetAddress": {
                                        "type": [
                                            "string",
                                            "object",
                                            "null"
                                        ]
                                    },
                                    "d2p1:SupervisorAlternativeFirstName": {
                                        "type": [
                                            "string",
                                            "object",
                                            "null"
                                        ]
                                    },
                                    "d2p1:SupervisorEmail": {
                                        "type": [
                                            "string",
                                            "object",
                                            "null"
                                        ]
                                    },
                                    "d2p1:SupervisorEmployeeType": {
                                        "type": "string"
                                    },
                                    "d2p1:SupervisorFirstName": {
                                        "type": [
                                            "string",
                                            "object",
                                            "null"
                                        ]
                                    },
                                    "d2p1:SupervisorId": {
                                        "type": [
                                            "string",
                                            "object",
                                            "null"
                                        ]
                                    },
                                    "d2p1:SupervisorLastName": {
                                        "type": [
                                            "string",
                                            "object",
                                            "null"
                                        ]
                                    },
                                    "d2p1:SupervisorMiddleName": {
                                        "type": [
                                            "string",
                                            "object",
                                            "null"
                                        ]
                                    },
                                    "d2p1:SupervisorMobilePhone": {
                                        "type": [
                                            "string",
                                            "object",
                                            "null"
                                        ]
                                    },
                                    "d2p1:SupervisorMobilePhoneFormatted": {
                                        "type": "object",
                                        "properties": {
                                            "@@i:nil": {
                                                "type": [
                                                    "string",
                                                    "object",
                                                    "null"
                                                ]
                                            }
                                        }
                                    },
                                    "d2p1:SupervisorMobilePhoneIsForeign": {
                                        "type": [
                                            "string",
                                            "object",
                                            "null"
                                        ]
                                    },
                                    "d2p1:SupervisorOfficialPhone": {
                                        "type": [
                                            "string",
                                            "object",
                                            "null"
                                        ]
                                    },
                                    "d2p1:SupervisorOfficialPhoneFormatted": {
                                        "type": "object",
                                        "properties": {
                                            "@@i:nil": {
                                                "type": [
                                                    "string",
                                                    "object",
                                                    "null"
                                                ]
                                            }
                                        }
                                    },
                                    "d2p1:SupervisorOfficialPhoneIsForeign": {
                                        "type": [
                                            "string",
                                            "object",
                                            "null"
                                        ]
                                    },
                                    "d2p1:SupervisorTitle": {
                                        "type": [
                                            "string",
                                            "object",
                                            "null"
                                        ]
                                    },
                                    "d2p1:Title": {
                                        "type": "string"
                                    },
                                    "d2p1:UserPrincipalName": {
                                        "type": "string"
                                    }
                                },
                                "required": [
                                    "d2p1:AgencyCode",
                                    "d2p1:AlternativeFirstName",
                                    "d2p1:EmployeeType",
                                    "d2p1:FirstName",
                                    "d2p1:FormattedSupervisorName",
                                    "d2p1:Grade",
                                    "d2p1:Id",
                                    "d2p1:IsActive",
                                    "d2p1:LastName",
                                    "d2p1:Location",
                                    "d2p1:LocationId",
                                    "d2p1:MiddleName",
                                    "d2p1:MobilePhone",
                                    "d2p1:MobilePhoneFormatted",
                                    "d2p1:MobilePhoneIsForeign",
                                    "d2p1:Office",
                                    "d2p1:OfficePhone",
                                    "d2p1:OfficePhoneFormatted",
                                    "d2p1:OfficePhoneIsForeign",
                                    "d2p1:OfficialEmail",
                                    "d2p1:OrgCode",
                                    "d2p1:OrgName",
                                    "d2p1:Series",
                                    "d2p1:Step",
                                    "d2p1:StreetAddress",
                                    "d2p1:SupervisorAlternativeFirstName",
                                    "d2p1:SupervisorEmail",
                                    "d2p1:SupervisorEmployeeType",
                                    "d2p1:SupervisorFirstName",
                                    "d2p1:SupervisorId",
                                    "d2p1:SupervisorLastName",
                                    "d2p1:SupervisorMiddleName",
                                    "d2p1:SupervisorMobilePhone",
                                    "d2p1:SupervisorMobilePhoneFormatted",
                                    "d2p1:SupervisorMobilePhoneIsForeign",
                                    "d2p1:SupervisorOfficialPhone",
                                    "d2p1:SupervisorOfficialPhoneFormatted",
                                    "d2p1:SupervisorOfficialPhoneIsForeign",
                                    "d2p1:SupervisorTitle",
                                    "d2p1:Title",
                                    "d2p1:UserPrincipalName"
                                ]
                            }
                        }
                    }
                },
                "Message": {
                    "type": "object",
                    "properties": {
                        "@@i:nil": {
                            "type": "string"
                        }
                    }
                },
                "Total": {
                    "type": "string"
                }
            }
        }
    }
}

 

 

The only usable variable i got was title and it worked, it filled my list. If i can only get the other 30 I need. 

grantjenkins
Super User
Super User

That raw output you provided for the array of customer data has a body/value element that contains an array of the customer data. Looks like if we can just return that array then we should be able to loop over each of your customers and get the data. I'll see what I can come up with during the day.

grantjenkins_1-1666395857633.png

 


----------------------------------------------------------------------
If I've answered your question, please mark the post as Solved.
If you like my response, please consider giving it a Thumbs Up.
grantjenkins
Super User
Super User

At the moment the only thing causing issues for me with the initial data is the odata properties (no valid).

grantjenkins_0-1666398584021.png

If I remove those manually from the input, then I can get the following:

grantjenkins_7-1666398029291.png

 

The Compose just contains the raw data (excluding the odata properties).

grantjenkins_8-1666398051340.png

 

The Parse JSON takes in the output of the Compose down to body/value:

 

outputs('Compose')?['body/value']

 

 grantjenkins_9-1666398077257.png

 

And using the following schema:

{
    "type": "array",
    "items": {
        "type": "object",
        "properties": {
            "No": {
                "type": "string"
            },
            "Name": {
                "type": "string"
            },
            "Name_2": {
                "type": "string"
            },
            "Search_Name": {
                "type": "string"
            },
            "IC_Partner_Code": {
                "type": "string"
            },
            "Balance_LCY": {
                "type": "integer"
            },
            "Balance_Due_LCY": {
                "type": "integer"
            },
            "Credit_Limit_LCY": {
                "type": "integer"
            },
            "Blocked": {
                "type": "string"
            },
            "Privacy_Blocked": {
                "type": "boolean"
            },
            "Salesperson_Code": {
                "type": "string"
            },
            "Responsibility_Center": {
                "type": "string"
            },
            "Service_Zone_Code": {
                "type": "string"
            },
            "Document_Sending_Profile": {
                "type": "string"
            },
            "TotalSales2": {
                "type": "integer"
            },
            "CustSalesLCY_CustProfit_AdjmtCostLCY": {
                "type": "integer"
            },
            "AdjCustProfit": {
                "type": "integer"
            },
            "AdjProfitPct": {
                "type": "integer"
            },
            "CFDI_Purpose": {
                "type": "string"
            },
            "CFDI_Relation": {
                "type": "string"
            },
            "CFDI_Export_Code": {
                "type": "string"
            },
            "SAT_Tax_Regime_Classification": {
                "type": "string"
            },
            "Last_Date_Modified": {
                "type": "string"
            },
            "Disable_Search_by_Name": {
                "type": "boolean"
            },
            "WSI_Square_Footage": {
                "type": "string"
            },
            "WSI_Contract_End_Date": {
                "type": "string"
            },
            "WSI_County": {
                "type": "string"
            },
            "WSI_Epay_ID": {
                "type": "string"
            },
            "Address": {
                "type": "string"
            },
            "Address_2": {
                "type": "string"
            },
            "Country_Region_Code": {
                "type": "string"
            },
            "City": {
                "type": "string"
            },
            "County": {
                "type": "string"
            },
            "Post_Code": {
                "type": "string"
            },
            "ShowMap": {
                "type": "string"
            },
            "Phone_No": {
                "type": "string"
            },
            "MobilePhoneNo": {
                "type": "string"
            },
            "E_Mail": {
                "type": "string"
            },
            "Fax_No": {
                "type": "string"
            },
            "Home_Page": {
                "type": "string"
            },
            "Language_Code": {
                "type": "string"
            },
            "Primary_Contact_No": {
                "type": "string"
            },
            "ContactName": {
                "type": "string"
            },
            "Bill_to_Customer_No": {
                "type": "string"
            },
            "VAT_Registration_No": {
                "type": "string"
            },
            "EORI_Number": {
                "type": "string"
            },
            "GLN": {
                "type": "string"
            },
            "Use_GLN_in_Electronic_Document": {
                "type": "boolean"
            },
            "Copy_Sell_to_Addr_to_Qte_From": {
                "type": "string"
            },
            "Tax_Liable": {
                "type": "boolean"
            },
            "Tax_Area_Code": {
                "type": "string"
            },
            "Tax_Identification_Type": {
                "type": "string"
            },
            "Tax_Exemption_No": {
                "type": "string"
            },
            "RFC_No": {
                "type": "string"
            },
            "CURP_No": {
                "type": "string"
            },
            "State_Inscription": {
                "type": "string"
            },
            "Gen_Bus_Posting_Group": {
                "type": "string"
            },
            "VAT_Bus_Posting_Group": {
                "type": "string"
            },
            "Customer_Posting_Group": {
                "type": "string"
            },
            "Currency_Code": {
                "type": "string"
            },
            "Price_Calculation_Method": {
                "type": "string"
            },
            "Customer_Price_Group": {
                "type": "string"
            },
            "Customer_Disc_Group": {
                "type": "string"
            },
            "Allow_Line_Disc": {
                "type": "boolean"
            },
            "Invoice_Disc_Code": {
                "type": "string"
            },
            "Prices_Including_VAT": {
                "type": "boolean"
            },
            "Prepayment_Percent": {
                "type": "integer"
            },
            "Application_Method": {
                "type": "string"
            },
            "Partner_Type": {
                "type": "string"
            },
            "Payment_Terms_Code": {
                "type": "string"
            },
            "Payment_Method_Code": {
                "type": "string"
            },
            "Reminder_Terms_Code": {
                "type": "string"
            },
            "Fin_Charge_Terms_Code": {
                "type": "string"
            },
            "Cash_Flow_Payment_Terms_Code": {
                "type": "string"
            },
            "Print_Statements": {
                "type": "boolean"
            },
            "Last_Statement_No": {
                "type": "integer"
            },
            "Block_Payment_Tolerance": {
                "type": "boolean"
            },
            "Preferred_Bank_Account_Code": {
                "type": "string"
            },
            "Bank_Communication": {
                "type": "string"
            },
            "Check_Date_Format": {
                "type": "string"
            },
            "Check_Date_Separator": {
                "type": "string"
            },
            "Ship_to_Code": {
                "type": "string"
            },
            "Location_Code": {
                "type": "string"
            },
            "Combine_Shipments": {
                "type": "boolean"
            },
            "Reserve": {
                "type": "string"
            },
            "Shipping_Advice": {
                "type": "string"
            },
            "Shipment_Method_Code": {
                "type": "string"
            },
            "Shipping_Agent_Code": {
                "type": "string"
            },
            "Shipping_Agent_Service_Code": {
                "type": "string"
            },
            "Shipping_Time": {
                "type": "string"
            },
            "Base_Calendar_Code": {
                "type": "string"
            },
            "Customized_Calendar": {
                "type": "string"
            },
            "ExpectedCustMoneyOwed": {
                "type": "integer"
            },
            "TotalMoneyOwed": {
                "type": "integer"
            },
            "CalcCreditLimitLCYExpendedPct": {
                "type": "integer"
            },
            "Balance_Due": {
                "type": "integer"
            },
            "Payments_LCY": {
                "type": "integer"
            },
            "CustomerMgt_AvgDaysToPay_No": {
                "type": "integer"
            },
            "DaysPaidPastDueDate": {
                "type": "integer"
            },
            "AmountOnPostedInvoices": {
                "type": "integer"
            },
            "AmountOnCrMemo": {
                "type": "integer"
            },
            "AmountOnOutstandingInvoices": {
                "type": "integer"
            },
            "AmountOnOutstandingCrMemos": {
                "type": "integer"
            },
            "CustInvDiscAmountLCY": {
                "type": "integer"
            },
            "Global_Dimension_1_Filter": {
                "type": "string"
            },
            "Global_Dimension_2_Filter": {
                "type": "string"
            },
            "Currency_Filter": {
                "type": "string"
            },
            "Date_Filter": {
                "type": "string"
            }
        },
        "required": [
            "No",
            "Name",
            "Name_2",
            "Search_Name",
            "IC_Partner_Code",
            "Balance_LCY",
            "Balance_Due_LCY",
            "Credit_Limit_LCY",
            "Blocked",
            "Privacy_Blocked",
            "Salesperson_Code",
            "Responsibility_Center",
            "Service_Zone_Code",
            "Document_Sending_Profile",
            "TotalSales2",
            "CustSalesLCY_CustProfit_AdjmtCostLCY",
            "AdjCustProfit",
            "AdjProfitPct",
            "CFDI_Purpose",
            "CFDI_Relation",
            "CFDI_Export_Code",
            "SAT_Tax_Regime_Classification",
            "Last_Date_Modified",
            "Disable_Search_by_Name",
            "WSI_Square_Footage",
            "WSI_Contract_End_Date",
            "WSI_County",
            "WSI_Epay_ID",
            "Address",
            "Address_2",
            "Country_Region_Code",
            "City",
            "County",
            "Post_Code",
            "ShowMap",
            "Phone_No",
            "MobilePhoneNo",
            "E_Mail",
            "Fax_No",
            "Home_Page",
            "Language_Code",
            "Primary_Contact_No",
            "ContactName",
            "Bill_to_Customer_No",
            "VAT_Registration_No",
            "EORI_Number",
            "GLN",
            "Use_GLN_in_Electronic_Document",
            "Copy_Sell_to_Addr_to_Qte_From",
            "Tax_Liable",
            "Tax_Area_Code",
            "Tax_Identification_Type",
            "Tax_Exemption_No",
            "RFC_No",
            "CURP_No",
            "State_Inscription",
            "Gen_Bus_Posting_Group",
            "VAT_Bus_Posting_Group",
            "Customer_Posting_Group",
            "Currency_Code",
            "Price_Calculation_Method",
            "Customer_Price_Group",
            "Customer_Disc_Group",
            "Allow_Line_Disc",
            "Invoice_Disc_Code",
            "Prices_Including_VAT",
            "Prepayment_Percent",
            "Application_Method",
            "Partner_Type",
            "Payment_Terms_Code",
            "Payment_Method_Code",
            "Reminder_Terms_Code",
            "Fin_Charge_Terms_Code",
            "Cash_Flow_Payment_Terms_Code",
            "Print_Statements",
            "Last_Statement_No",
            "Block_Payment_Tolerance",
            "Preferred_Bank_Account_Code",
            "Bank_Communication",
            "Check_Date_Format",
            "Check_Date_Separator",
            "Ship_to_Code",
            "Location_Code",
            "Combine_Shipments",
            "Reserve",
            "Shipping_Advice",
            "Shipment_Method_Code",
            "Shipping_Agent_Code",
            "Shipping_Agent_Service_Code",
            "Shipping_Time",
            "Base_Calendar_Code",
            "Customized_Calendar",
            "ExpectedCustMoneyOwed",
            "TotalMoneyOwed",
            "CalcCreditLimitLCYExpendedPct",
            "Balance_Due",
            "Payments_LCY",
            "CustomerMgt_AvgDaysToPay_No",
            "DaysPaidPastDueDate",
            "AmountOnPostedInvoices",
            "AmountOnCrMemo",
            "AmountOnOutstandingInvoices",
            "AmountOnOutstandingCrMemos",
            "CustInvDiscAmountLCY",
            "Global_Dimension_1_Filter",
            "Global_Dimension_2_Filter",
            "Currency_Filter",
            "Date_Filter"
        ]
    }
}

 

And as an example, I've added a Create HTML table using the output of the Parse JSON action with the ability to get each of the properties.

grantjenkins_10-1666398125518.png

 

Now how to remove those odata properties dynamically from the input (working on it).

 


----------------------------------------------------------------------
If I've answered your question, please mark the post as Solved.
If you like my response, please consider giving it a Thumbs Up.

I am so sorry for the confusion. The raw data I posted, I found randomly online. I am a total noob to flows and have only used it a couple of times. I have never created a list, never the less had no idea what json, nor a schema was. I was confused as to what the output was supposed to look. I thought initially that was the issue. Unfortunately, the raw data does have private information an I wont be able to post it online. Otherwise, i know i would get more help. I have been working on this for a week both at work and continuing at home. Learning by trial and error. But I'm getting closer, I can feel it.. 😅

I did find this sample data. Hope fully this is useful. 

 

{
  "count": 0,
  "data": [
    {
      "agencyCode": "string",
      "alternativeFirstName": "string",
      "employeeType": 0,
      "firstName": "string",
      "formattedName": "string",
      "formattedSupervisorName": "string",
      "grade": 0,
      "id": "string",
      "isActive": true,
      "lastName": "string",
      "location": "string",
      "locationId": 0,
      "middleName": "string",
      "mobilePhone": "string",
      "mobilePhoneFormatted": "string",
      "mobilePhoneIsForeign": true,
      "office": "string",
      "officePhone": "string",
      "officePhoneFormatted": "string",
      "officePhoneIsForeign": true,
      "officialEmail": "string",
      "orgCode": "string",
      "orgName": "string",
      "series": 0,
      "step": 0,
      "streetAddress": "string",
      "supervisorAlternativeFirstName": "string",
      "supervisorEmail": "string",
      "supervisorFirstName": "string",
      "supervisorId": "string",
      "supervisorEmployeeType": 0,
      "supervisorLastName": "string",
      "supervisorMiddleName": "string",
      "supervisorTitle": "string",
      "supervisorOfficialPhone": "string",
      "supervisorOfficialPhoneFormatted": "string",
      "supervisorMobilePhone": "string",
      "supervisorMobilePhoneFormatted": "string",
      "supervisorMobilePhoneIsForeign": true,
      "supervisorOfficialPhoneIsForeign": true,
      "userPrincipalName": "string",
      "title": "string"
    }
  ],
  "message": "string",
  "total": 0
}

 

Ok. One step closer. I noticed the in the title i did not put the ["string","object","null"] string so it showed under dynamic list. So i tried it under "name" and now that shows as a dynamic object too. But if get an item that has no value (empty or null) i get the following expected object but got string error. 

 

Capture2.PNGCapture.PNG

Hope you can help. I made it past the Parser Json. But now im getting a new error once i get to the create item.

 

{
    "type": "object",
    "properties": {
        "d2p1:PublicEmployee": {
            "type": "array",
            "items": {
                "type": "object",
                "properties": {
                    "d2p1:AgencyCode": {
                        "type": "string"
                    },
                    "d2p1:AlternativeFirstName": {
                        "type": "object",
                        "properties": {
                            "@@i:nil": {
                                "type": "string"
                            }
                        }
                    },
                    "d2p1:EmployeeType": {
                        "type": "string"
                    },
                    "d2p1:FirstName": {
                        "type": "string"
                    },
                    "d2p1:FormattedSupervisorName": {
                        "type": "string"
                    },
                    "d2p1:Grade": {
                        "type": "string"
                    },
                    "d2p1:Id": {
                        "type": "string"
                    },
                    "d2p1:IsActive": {
                        "type": "string"
                    },
                    "d2p1:LastName": {
                        "type": "string"
                    },
                    "d2p1:Location": {
                        "type": "string"
                    },
                    "d2p1:LocationId": {
                        "type": "string"
                    },
                    "d2p1:MiddleName": {
                        "type": "string"
                    },
                    "d2p1:MobilePhone": {
                        "type": "string"
                    },
                    "d2p1:MobilePhoneFormatted": {
                        "type": "string"
                    },
                    "d2p1:MobilePhoneIsForeign": {
                        "type": "string"
                    },
                    "d2p1:Office": {
                        "type": "string"
                    },
                    "d2p1:OfficePhone": {
                        "type": "string"
                    },
                    "d2p1:OfficePhoneFormatted": {
                        "type": "string"
                    },
                    "d2p1:OfficePhoneIsForeign": {
                        "type": "string"
                    },
                    "d2p1:OfficialEmail": {
                        "type": "string"
                    },
                    "d2p1:OrgCode": {
                        "type": "string"
                    },
                    "d2p1:OrgName": {
                        "type": "string"
                    },
                    "d2p1:Series": {
                        "type": "string"
                    },
                    "d2p1:Step": {
                        "type": "string"
                    },
                    "d2p1:StreetAddress": {
                        "type": "string"
                    },
                    "d2p1:SupervisorAlternativeFirstName": {
                        "type": "string"
                    },
                    "d2p1:SupervisorEmail": {
                        "type": "string"
                    },
                    "d2p1:SupervisorEmployeeType": {
                        "type": "string"
                    },
                    "d2p1:SupervisorFirstName": {
                        "type": "string"
                    },
                    "d2p1:SupervisorId": {
                        "type": "string"
                    },
                    "d2p1:SupervisorLastName": {
                        "type": "string"
                    },
                    "d2p1:SupervisorMiddleName": {
                        "type": "string"
                    },
                    "d2p1:SupervisorMobilePhone": {
                        "type": "string"
                    },
                    "d2p1:SupervisorMobilePhoneFormatted": {
                        "type": "object",
                        "properties": {
                            "@@i:nil": {
                                "type": "string"
                            }
                        }
                    },
                    "d2p1:SupervisorMobilePhoneIsForeign": {
                        "type": "string"
                    },
                    "d2p1:SupervisorOfficialPhone": {
                        "type": "string"
                    },
                    "d2p1:SupervisorOfficialPhoneFormatted": {
                        "type": "object",
                        "properties": {
                            "@@i:nil": {
                                "type": "string"
                            }
                        }
                    },
                    "d2p1:SupervisorOfficialPhoneIsForeign": {
                        "type": "string"
                    },
                    "d2p1:SupervisorTitle": {
                        "type": "string"
                    },
                    "d2p1:Title": {
                        "type": "string"
                    },
                    "d2p1:UserPrincipalName": {
                        "type": "string"
                    }
                },
                "required": [
                    "d2p1:AgencyCode",
                    "d2p1:AlternativeFirstName",
                    "d2p1:EmployeeType",
                    "d2p1:FirstName",
                    "d2p1:FormattedSupervisorName",
                    "d2p1:Grade",
                    "d2p1:Id",
                    "d2p1:IsActive",
                    "d2p1:LastName",
                    "d2p1:Location",
                    "d2p1:LocationId",
                    "d2p1:MiddleName",
                    "d2p1:MobilePhone",
                    "d2p1:MobilePhoneFormatted",
                    "d2p1:MobilePhoneIsForeign",
                    "d2p1:Office",
                    "d2p1:OfficePhone",
                    "d2p1:OfficePhoneFormatted",
                    "d2p1:OfficePhoneIsForeign",
                    "d2p1:OfficialEmail",
                    "d2p1:OrgCode",
                    "d2p1:OrgName",
                    "d2p1:Series",
                    "d2p1:Step",
                    "d2p1:StreetAddress",
                    "d2p1:SupervisorAlternativeFirstName",
                    "d2p1:SupervisorEmail",
                    "d2p1:SupervisorEmployeeType",
                    "d2p1:SupervisorFirstName",
                    "d2p1:SupervisorId",
                    "d2p1:SupervisorLastName",
                    "d2p1:SupervisorMiddleName",
                    "d2p1:SupervisorMobilePhone",
                    "d2p1:SupervisorMobilePhoneFormatted",
                    "d2p1:SupervisorMobilePhoneIsForeign",
                    "d2p1:SupervisorOfficialPhone",
                    "d2p1:SupervisorOfficialPhoneFormatted",
                    "d2p1:SupervisorOfficialPhoneIsForeign",
                    "d2p1:SupervisorTitle",
                    "d2p1:Title",
                    "d2p1:UserPrincipalName"
                ]
            }
        }
    }
}

New error.PNG

grantjenkins
Super User
Super User

Can you have a look at the output of the Parse JSON action to see if you are getting anything back for that property. The output needs to be an array of objects.


----------------------------------------------------------------------
If I've answered your question, please mark the post as Solved.
If you like my response, please consider giving it a Thumbs Up.
CRod
Helper I
Helper I

Yes, I am. I removed I removed a portion of the schema. 

        "PublicEmployeeResponse": {
            "type": "object",
            "properties": {
                "@@xmlns:i": {
                    "type": "string"
                },
                "@@xmlns": {
                    "type": "string"
                },
                "Count": {
                    "type": "string"
                },
                "Data": {
                    "type": "object",
                    "properties": {
                        "@@xmlns:d2p1": {
                            "type": "string"

 

I need the array of Public employees, so i thought that eliminating the part I dont need from the schema would work. It got rid of the "expected object got string' error but now I'm getting that error. 

I removed all the original data from this xml and shrunk it to two employees. I thought i was getting the error for the null values but i fill all entries and I still get the error. It does parse but it will not create the items, giving me that null error. 

<PublicEmployeeResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/WebTele.Web.Features.PublicEmployeeApi.Common">
  <Count>2</Count>
  <Data xmlns:d2p1="http://schemas.datacontract.org/2004/07/WebTele.Application.Domain.Entities">
    <d2p1:PublicEmployee>
      <d2p1:AgencyCode>QA</d2p1:AgencyCode>
      <d2p1:AlternativeFirstName i:nil="true" />
      <d2p1:EmployeeType>Walmart</d2p1:EmployeeType>
      <d2p1:FirstName>SAM</d2p1:FirstName>
      <d2p1:FormattedSupervisorName>Test, Charles</d2p1:FormattedSupervisorName>
      <d2p1:Grade>Sales</d2p1:Grade>
      <d2p1:Id>aaaaaa</d2p1:Id>
      <d2p1:IsActive>true</d2p1:IsActive>
      <d2p1:LastName>Galigan</d2p1:LastName>
      <d2p1:Location>Chicago</d2p1:Location>
      <d2p1:LocationId>1111</d2p1:LocationId>
      <d2p1:MiddleName>A</d2p1:MiddleName>
      <d2p1:MobilePhone>0000000000</d2p1:MobilePhone>
      <d2p1:MobilePhoneFormatted>(000) 000-0000</d2p1:MobilePhoneFormatted>
      <d2p1:MobilePhoneIsForeign>false</d2p1:MobilePhoneIsForeign>
      <d2p1:Office>Toys</d2p1:Office>
      <d2p1:OfficePhone>0000000000</d2p1:OfficePhone>
      <d2p1:OfficePhoneFormatted>(000) 000-0000</d2p1:OfficePhoneFormatted>
      <d2p1:OfficePhoneIsForeign>false</d2p1:OfficePhoneIsForeign>
      <d2p1:OfficialEmail>SamGaligan@Walmart.com</d2p1:OfficialEmail>
      <d2p1:OrgCode>0000000000000000</d2p1:OrgCode>
      <d2p1:OrgName>Walmart000</d2p1:OrgName>
      <d2p1:Series>1111</d2p1:Series>
      <d2p1:Step>1</d2p1:Step>
      <d2p1:StreetAddress>111 Walmart St</d2p1:StreetAddress>
      <d2p1:SupervisorAlternativeFirstName>Sammy</d2p1:SupervisorAlternativeFirstName>
      <d2p1:SupervisorEmail>SamWalter@Walmart.com</d2p1:SupervisorEmail>
      <d2p1:SupervisorEmployeeType>None</d2p1:SupervisorEmployeeType>
      <d2p1:SupervisorFirstName>Sam</d2p1:SupervisorFirstName>
      <d2p1:SupervisorId>bbbbbbb</d2p1:SupervisorId>
      <d2p1:SupervisorLastName>Walter</d2p1:SupervisorLastName>
      <d2p1:SupervisorMiddleName>j</d2p1:SupervisorMiddleName>
      <d2p1:SupervisorMobilePhone>0000000000</d2p1:SupervisorMobilePhone>
      <d2p1:SupervisorMobilePhoneFormatted i:nil="true" />
      <d2p1:SupervisorMobilePhoneIsForeign>false</d2p1:SupervisorMobilePhoneIsForeign>
      <d2p1:SupervisorOfficialPhone>0000000000</d2p1:SupervisorOfficialPhone>
      <d2p1:SupervisorOfficialPhoneFormatted i:nil="true" />
      <d2p1:SupervisorOfficialPhoneIsForeign>false</d2p1:SupervisorOfficialPhoneIsForeign>
      <d2p1:SupervisorTitle>Supervisor</d2p1:SupervisorTitle>
      <d2p1:Title>Sales Man</d2p1:Title>
      <d2p1:UserPrincipalName>12345aaaa</d2p1:UserPrincipalName>
    </d2p1:PublicEmployee>
    <d2p1:PublicEmployee>
      <d2p1:AgencyCode>QA</d2p1:AgencyCode>
      <d2p1:AlternativeFirstName i:nil="true" />
      <d2p1:EmployeeType>Sales</d2p1:EmployeeType>
      <d2p1:FirstName>Charlie</d2p1:FirstName>
      <d2p1:FormattedSupervisorName>Walters, Test</d2p1:FormattedSupervisorName>
      <d2p1:Grade>as</d2p1:Grade>
      <d2p1:Id>ppssos8</d2p1:Id>
      <d2p1:IsActive>true</d2p1:IsActive>
      <d2p1:LastName>Strips</d2p1:LastName>
      <d2p1:Location>Texas</d2p1:Location>
      <d2p1:LocationId>2222</d2p1:LocationId>
      <d2p1:MiddleName>B</d2p1:MiddleName>
      <d2p1:MobilePhone>1111111111</d2p1:MobilePhone>
      <d2p1:MobilePhoneFormatted>(111) 111-1111</d2p1:MobilePhoneFormatted>
      <d2p1:MobilePhoneIsForeign>false</d2p1:MobilePhoneIsForeign>
      <d2p1:Office>Texas</d2p1:Office>
      <d2p1:OfficePhone>1111111111</d2p1:OfficePhone>
      <d2p1:OfficePhoneFormatted>(000) 111-1000</d2p1:OfficePhoneFormatted>
      <d2p1:OfficePhoneIsForeign>false</d2p1:OfficePhoneIsForeign>
      <d2p1:OfficialEmail>testr@walmart.com</d2p1:OfficialEmail>
      <d2p1:OrgCode>0000000000000000</d2p1:OrgCode>
      <d2p1:OrgName>Walmart000</d2p1:OrgName>
      <d2p1:Series>1111</d2p1:Series>
      <d2p1:Step>1</d2p1:Step>
      <d2p1:StreetAddress>111 Walmart St</d2p1:StreetAddress>
      <d2p1:SupervisorAlternativeFirstName>Sammy</d2p1:SupervisorAlternativeFirstName>
      <d2p1:SupervisorEmail>SamWalter@Walmart.com</d2p1:SupervisorEmail>
      <d2p1:SupervisorEmployeeType>None</d2p1:SupervisorEmployeeType>
      <d2p1:SupervisorFirstName>Sam</d2p1:SupervisorFirstName>
      <d2p1:SupervisorId>bbbbbbb</d2p1:SupervisorId>
      <d2p1:SupervisorLastName>Walter</d2p1:SupervisorLastName>
      <d2p1:SupervisorMiddleName>j</d2p1:SupervisorMiddleName>
      <d2p1:SupervisorMobilePhone>0000000000</d2p1:SupervisorMobilePhone>
      <d2p1:SupervisorMobilePhoneFormatted i:nil="true" />
      <d2p1:SupervisorMobilePhoneIsForeign>false</d2p1:SupervisorMobilePhoneIsForeign>
      <d2p1:SupervisorOfficialPhone>0000000000</d2p1:SupervisorOfficialPhone>
      <d2p1:SupervisorOfficialPhoneFormatted i:nil="true" />
      <d2p1:SupervisorOfficialPhoneIsForeign>false</d2p1:SupervisorOfficialPhoneIsForeign>
      <d2p1:SupervisorTitle>Supervisor</d2p1:SupervisorTitle>
      <d2p1:Title>Sales Man</d2p1:Title>
      <d2p1:UserPrincipalName>12345bbbbb</d2p1:UserPrincipalName>
    </d2p1:PublicEmployee>
  </Data>
  <Message i:nil="true" />
  <Total>0</Total>
</PublicEmployeeResponse>
grantjenkins
Super User
Super User

I think I might have something that works, including removing the d2p1: from each property. See below:

 

The full flow is below. I'll go into each action.

grantjenkins_0-1666482138761.png

 

Compose XML is just the raw data that you provided for the two employees.

grantjenkins_1-1666482195322.png

 

Compose Remove d2p1: strips out any instances of the text d2p1: so you get nicer property names. The expression I use here is:

replace(outputs('Compose_XML'), 'd2p1:', '')

grantjenkins_2-1666482303041.png

 

Compose JSON converts the XML to JSON. Note that it wraps an xml expression within a json expression as so:

json(xml(outputs('Compose_Remove_d2p1:')))

grantjenkins_3-1666482380323.png

 

Compose Public Employee allows us to just return the PublicEmployee array of objects which is all we want. The expression is:

outputs('Compose_JSON')?['PublicEmployeeResponse/Data/PublicEmployee']

grantjenkins_4-1666482493223.png

 

Finally, we use Parse JSON using the schema that was generated from the Compose Public Employee Output.

grantjenkins_5-1666482571463.png

 

The Schema is:

{
    "type": "array",
    "items": {
        "type": "object",
        "properties": {
            "AgencyCode": {
                "type": "string"
            },
            "AlternativeFirstName": {
                "type": "object",
                "properties": {
                    "@@i:nil": {
                        "type": "string"
                    }
                }
            },
            "EmployeeType": {
                "type": "string"
            },
            "FirstName": {
                "type": "string"
            },
            "FormattedSupervisorName": {
                "type": "string"
            },
            "Grade": {
                "type": "string"
            },
            "Id": {
                "type": "string"
            },
            "IsActive": {
                "type": "string"
            },
            "LastName": {
                "type": "string"
            },
            "Location": {
                "type": "string"
            },
            "LocationId": {
                "type": "string"
            },
            "MiddleName": {
                "type": "string"
            },
            "MobilePhone": {
                "type": "string"
            },
            "MobilePhoneFormatted": {
                "type": "string"
            },
            "MobilePhoneIsForeign": {
                "type": "string"
            },
            "Office": {
                "type": "string"
            },
            "OfficePhone": {
                "type": "string"
            },
            "OfficePhoneFormatted": {
                "type": "string"
            },
            "OfficePhoneIsForeign": {
                "type": "string"
            },
            "OfficialEmail": {
                "type": "string"
            },
            "OrgCode": {
                "type": "string"
            },
            "OrgName": {
                "type": "string"
            },
            "Series": {
                "type": "string"
            },
            "Step": {
                "type": "string"
            },
            "StreetAddress": {
                "type": "string"
            },
            "SupervisorAlternativeFirstName": {
                "type": "string"
            },
            "SupervisorEmail": {
                "type": "string"
            },
            "SupervisorEmployeeType": {
                "type": "string"
            },
            "SupervisorFirstName": {
                "type": "string"
            },
            "SupervisorId": {
                "type": "string"
            },
            "SupervisorLastName": {
                "type": "string"
            },
            "SupervisorMiddleName": {
                "type": "string"
            },
            "SupervisorMobilePhone": {
                "type": "string"
            },
            "SupervisorMobilePhoneFormatted": {
                "type": "object",
                "properties": {
                    "@@i:nil": {
                        "type": "string"
                    }
                }
            },
            "SupervisorMobilePhoneIsForeign": {
                "type": "string"
            },
            "SupervisorOfficialPhone": {
                "type": "string"
            },
            "SupervisorOfficialPhoneFormatted": {
                "type": "object",
                "properties": {
                    "@@i:nil": {
                        "type": "string"
                    }
                }
            },
            "SupervisorOfficialPhoneIsForeign": {
                "type": "string"
            },
            "SupervisorTitle": {
                "type": "string"
            },
            "Title": {
                "type": "string"
            },
            "UserPrincipalName": {
                "type": "string"
            }
        },
        "required": [
            "AgencyCode",
            "AlternativeFirstName",
            "EmployeeType",
            "FirstName",
            "FormattedSupervisorName",
            "Grade",
            "Id",
            "IsActive",
            "LastName",
            "Location",
            "LocationId",
            "MiddleName",
            "MobilePhone",
            "MobilePhoneFormatted",
            "MobilePhoneIsForeign",
            "Office",
            "OfficePhone",
            "OfficePhoneFormatted",
            "OfficePhoneIsForeign",
            "OfficialEmail",
            "OrgCode",
            "OrgName",
            "Series",
            "Step",
            "StreetAddress",
            "SupervisorAlternativeFirstName",
            "SupervisorEmail",
            "SupervisorEmployeeType",
            "SupervisorFirstName",
            "SupervisorId",
            "SupervisorLastName",
            "SupervisorMiddleName",
            "SupervisorMobilePhone",
            "SupervisorMobilePhoneFormatted",
            "SupervisorMobilePhoneIsForeign",
            "SupervisorOfficialPhone",
            "SupervisorOfficialPhoneFormatted",
            "SupervisorOfficialPhoneIsForeign",
            "SupervisorTitle",
            "Title",
            "UserPrincipalName"
        ]
    }
}

 

I've added an Apply to each just to test the output that we get is working and correct.

grantjenkins_6-1666482709289.png

 

 

 


----------------------------------------------------------------------
If I've answered your question, please mark the post as Solved.
If you like my response, please consider giving it a Thumbs Up.

Helpful resources

Announcements

Are you ready to SUIT UP and become a Super User? Find out how TODAY!

We can’t imagine our communities without the amazing work of our Super Users! They are the most active members of our community, offering incredible solutions, providing answers to questions across the forum, and working closely with the Microsoft Power Platform Community team to find new ways to engage our communities around the world.   If you are interested in becoming a Super User, today at #MPPC23, we annoucned a new way for you to “SUIT” up and earn your Super User badge! The new “Super User in Training” initiative is a great way for you to begin building your solution rate, engage with other community members, and find out what it takes to truly be SUPER.   Become a “super solver” across the Power Platform communities, whether you’re an expert in Power Apps or just getting started with Power Pages. No matter where you are on your Power Platform journey, we are here to encourage YOU to discover YOUR superpower! Don't sell your self short, even as a newcomer to Power Platform or Dynamics 365 you are on a journey of discovery.  In fact in my experience people that are just starting out are often the ones that can solve some of the  most challenging problems because the research they are doing to get ramped up is exactly what the person asking for help is seeking!   Find out more about the SUIT program for “Super Users in Training” at the Power Platform Community Lounge at #MPPC23. Not at the Conference, just click this link to find out how to sign up today: aka.ms/suit

Back to Basics: Tuesday Tip #2: All About Community Ranks

This weekly series is our way of helping the amazing members of our community--both new members and seasoned veterans--learn and grow in how to best engage in the community! Each Tuesday, we will feature new areas of content that will help you best understand the community--from ranking and badges to profile avatars, from Super Users to blogging in the community. Our hope is that this information will help each of our community members grow in their experience with Power Platform, with the community, and with each other!   Have you ever wondered how your fellow community members earn the different ranks available? What is the difference between an Advocate and a Helper, a Solution Sage and a Community Champion? In today's #TuesdayTip, we share the secrets and tips to help YOU keep your ranking growing--and why it's so important to our communities. What are community ranks? - Power Platform Community (microsoft.com)   Get the details in this Knowledge Base article that shows you what ranks are, how they are achieved, and what they mean to you as you engage with other community members on a regular basis. Once you start your journey in the community, ranking up, you'll find the benefits. So get busy with those kudos, solutions, and more! We can't wait to see how you rank!That's it for this week. Tune in for more Tuesday Tips next Tuesday and join the community as we continue to get "Back to Basics."

It's #MPPC23 Week! Check Out the Community Sessions and Events Happening in Vegas

After all the planning and preparing, the annual Microsoft Power Platform Conference is finally here! We are excited to see so many of our community in Las Vegas this week. To help make sure you don't miss any of the workshops, sessions, and events we have planned, make sure to check out this handy Community One-Sheet, and download the pdf today! Make sure to stop by the Community Lounge to meet @hugobernier, @EricArcher, @heaher_italent, and @AshleyFelts from our team!    

Join Us for the First-Ever Biz Apps Community User Group Meeting: Live from MPPC23

      Join us for the first-ever the Biz Apps Community User Group meeting live from the Power Platform Conference! This one hour user group meeting is all about discovering the value and benefits of User Groups! Discover how you can find a group in your local area or about specific topics where you can learn new skills and meet like-minded people as a user group member.   Hear from User Group leaders about why they do what they do and what resources they receive to help them succeed as community ambassadors. If you have never attended a User Group meeting before, this will be a great introduction! We hope you are inspired to find a group that meets your unique interests!   October 5th at 2:15 pm Pacific time   If you're attending #MPPC23 in Las Vegas, join us in person! Find out more here: https://powerplatformconf.com/#!/session/Biz%20Apps%20Community%20User%20Group%20Meeting%20-%20Live%20from%20MPPC/6172   Not at MPPC23? Attend vvirtually by registering here: https://aka.ms/MPPCusergroupmeeting2023    If you can't attend this meeting live, don't worry! We will record this meeting and share it with the Community at powerusers.microsoft.com 

Back to Basics: Tuesday Tip #1: All About YOUR Community Account

We are excited to kick off our new #TuesdayTIps series, "Back to Basics." This weekly series is our way of helping the amazing members of our community--both new members and seasoned veterans--learn and grow in how to best engage in the community! Each Tuesday, we will feature new areas of content that will help you best understand the community--from ranking and badges to profile avatars, from Super Users to blogging in the community. Our hope is that this information will help each of our community members grow in their experience with Power Platform, with the community, and with each other!     This Week's Tips: Account Support: Changing Passwords, Changing Email Addresses or Usernames, "Need Admin Approval," Etc.Wondering how to get support for your community account? Check out the details on these common questions and more. Just follow the link below for articles that explain it all.Community Account Support - Power Platform Community (microsoft.com)   All About GDPR: How It Affects Closing Your Community Account (And Why You Should Think Twice Before You Do)GDPR, the General Data Protection Regulation (GDPR), took effect May 25th 2018. A European privacy law, GDPR imposes new rules on companies and other organizations offering goods and services to people in the European Union (EU), or that collect and analyze data tied to EU residents. GDPR applies no matter where you are located, and it affects what happens when you decide to close your account. Read the details here:All About GDPR - Power Platform Community (microsoft.com)   Getting to Know You: Setting Up Your Community Profile, Customizing Your Profile, and More.Your community profile helps other members of the community get to know you as you begin to engage and interact. Your profile is a mirror of your activity in the community. Find out how to set it up, change your avatar, adjust your time zone, and more. Click on the link below to find out how:Community Profile, Time Zone, Picture (Avatar) & D... - Power Platform Community (microsoft.com)   That's it for this week. Tune in for more Tuesday Tips next Tuesday and join the community as we get "Back to Basics."

Announcing the MPPC's Got Power Talent Show at #MPPC23

Are you attending the Microsoft Power Platform Conference 2023 in Las Vegas? If so, we invite you to join us for the MPPC's Got Power Talent Show!      Our talent show is more than a show—it's a grand celebration of connection, inspiration, and shared journeys. Through stories, skills, and collective experiences, we come together to uplift, inspire, and revel in the magic of our community's diverse talents. This year, our talent event promises to be an unforgettable experience, echoing louder and brighter than anything you've seen before.    We're casting a wider net with three captivating categories:  Demo Technical Solutions: Show us your Power Platform innovations, be it apps, flows, chatbots, websites or dashboards... Storytelling: Share tales of your journey with Power Platform. Hidden Talents: Unveil your creative side—be it dancing, singing, rapping, poetry, or comedy. Let your talent shine!    Got That Special Spark? A Story That Demands to Be Heard? Your moment is now!  Sign up to Showcase Your Brilliance: https://aka.ms/MPPCGotPowerSignUp  Deadline for submissions: Thursday, Sept 28th    How It Works:  Submit this form to sign up: https://aka.ms/MPPCGotPowerSignUp  We'll contact you if you're selected. Get ready to be onstage!  The Spotlight is Yours: Each participant has 3-5 minutes to shine, with insightful commentary from our panel of judges. We’re not just giving you a stage; we’re handing you the platform to make your mark.     Be the Story We Tell: Your talents and narratives will not just entertain but inspire, serving as the bedrock for our community’s future stories and successes.    Celebration, Surprises, and Connections: As the curtain falls, the excitement continues! Await surprise awards and seize the chance to mingle with industry experts, Microsoft Power Platform leaders, and community luminaries. It's not just a show; it's an opportunity to forge connections and celebrate shared successes.    Event Details:  Date and Time: Wed Oct 4th, 6:30-9:00PM   Location: MPPC23 at the MGM Grand, Las Vegas, NV, USA  

Users online (2,235)