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

Convert JSON string to JSON array

Ive followed this same template 5 times already without any issue. 

proceduretocsv.PNG

Test is successfull until It gets to csv. 

I get the following error:

failure.PNG

The Table1 input  from Parse JSON is not null!

 

My parse json output shows:

{"body":{"Table1":[{"BatchCode":"CL20","EmployeeCode":"28907","Department":6160,"PayType":"R","regularhours":9.0,"Job":"","Phase":"","CostType":"","Date":"03/18/19","MessageLine":"","PayRateLevel":"","WageCode":"","UnionCode":"","WorkersComp":"","StateTaxCode":"","CountyTaxCode":"","LocalTaxCode":"","EquipmentCode":"0242","Equipmenthours":"","Quantity":"","CompanyCode":"","PayRate":"","EquipmentCostCategory":"6050","CrewNumber":"","CostCenter":"","WorkOrder":"","SiteEquipment":"","Sitecomponent":"","Contract":"","EquipmentWorkOrder":"161121","BillingCode":"","BillingRate":""},{"BatchCode":"CL20","EmployeeCode":"28907","Department":6160,"PayType":"R","regularhours":1.0,"Job":"","Phase":"","CostType":"","Date":"03/18/19","MessageLine":"","PayRateLevel":"","WageCode":"","UnionCode":"","WorkersComp":"","StateTaxCode":"","CountyTaxCode":"","LocalTaxCode":"","EquipmentCode":"8040","Equipmenthours":"","Quantity":"","CompanyCode":"","PayRate":"","EquipmentCostCategory":"4250","CrewNumber":"","CostCenter":"","WorkOrder":"","SiteEquipment":"","Sitecomponent":"","Contract":"","EquipmentWorkOrder":"160453","BillingCode":"","BillingRate":""},{"BatchCode":"CL20","EmployeeCode":"28907","Department":6160,"PayType":"R","regularhours":2.0,"Job":"","Phase":"","CostType":"","Date":"03/18/19","MessageLine":"","PayRateLevel":"","WageCode":"","UnionCode":"","WorkersComp":"","StateTaxCode":"","CountyTaxCode":"","LocalTaxCode":"","EquipmentCode":"0749","Equipmenthours":"","Quantity":"","CompanyCode":"","PayRate":"","EquipmentCostCategory":"3650","CrewNumber":"","CostCenter":"","WorkOrder":"","SiteEquipment":"","Sitecomponent":"","Contract":"","EquipmentWorkOrder":"161025","BillingCode":"","BillingRate":""},{"BatchCode":"CL20","EmployeeCode":"28907","Department":6160,"PayType":"R","regularhours":7.0,"Job":"","Phase":"","CostType":"","Date":"03/19/19","MessageLine":"","PayRateLevel":"","WageCode":"","UnionCode":"","WorkersComp":"","StateTaxCode":"","CountyTaxCode":"","LocalTaxCode":"","EquipmentCode":"0749","Equipmenthours":"","Quantity":"","CompanyCode":"","PayRate":"","EquipmentCostCategory":"3650","CrewNumber":"","CostCenter":"","WorkOrder":"","SiteEquipment":"","Sitecomponent":"","Contract":"","EquipmentWorkOrder":"161025","BillingCode":"","BillingRate":""},{"BatchCode":"CL20","EmployeeCode":"28907","Department":6160,"PayType":"R","regularhours":1.0,"Job":"","Phase":"","CostType":"","Date":"03  .

Why am I getting this "Null" error in the Create CSV ?

1 ACCEPTED SOLUTION

Accepted Solutions
v-zhos-msft
Solution Sage
Solution Sage

Hi @SPOFLOW ,

I sugget you add a 'Compose' action to check the output of the Table1, make sure the output is an array.

I have made a test with the json you have provided.

{  
   "body":{  
      "Table1":[  
         {  
            "BatchCode":"CL20",
            "EmployeeCode":"28907",
            "Department":6160,
            "PayType":"R",
            "regularhours":9.0,
            "Job":"",
            "Phase":"",
            "CostType":"",
            "Date":"03/18/19",
            "MessageLine":"",
            "PayRateLevel":"",
            "WageCode":"",
            "UnionCode":"",
            "WorkersComp":"",
            "StateTaxCode":"",
            "CountyTaxCode":"",
            "LocalTaxCode":"",
            "EquipmentCode":"0242",
            "Equipmenthours":"",
            "Quantity":"",
            "CompanyCode":"",
            "PayRate":"",
            "EquipmentCostCategory":"6050",
            "CrewNumber":"",
            "CostCenter":"",
            "WorkOrder":"",
            "SiteEquipment":"",
            "Sitecomponent":"",
            "Contract":"",
            "EquipmentWorkOrder":"161121",
            "BillingCode":"",
            "BillingRate":""
         },
         {  
            "BatchCode":"CL20",
            "EmployeeCode":"28907",
            "Department":6160,
            "PayType":"R",
            "regularhours":1.0,
            "Job":"",
            "Phase":"",
            "CostType":"",
            "Date":"03/18/19",
            "MessageLine":"",
            "PayRateLevel":"",
            "WageCode":"",
            "UnionCode":"",
            "WorkersComp":"",
            "StateTaxCode":"",
            "CountyTaxCode":"",
            "LocalTaxCode":"",
            "EquipmentCode":"8040",
            "Equipmenthours":"",
            "Quantity":"",
            "CompanyCode":"",
            "PayRate":"",
            "EquipmentCostCategory":"4250",
            "CrewNumber":"",
            "CostCenter":"",
            "WorkOrder":"",
            "SiteEquipment":"",
            "Sitecomponent":"",
            "Contract":"",
            "EquipmentWorkOrder":"160453",
            "BillingCode":"",
            "BillingRate":""
         },
         {  
            "BatchCode":"CL20",
            "EmployeeCode":"28907",
            "Department":6160,
            "PayType":"R",
            "regularhours":2.0,
            "Job":"",
            "Phase":"",
            "CostType":"",
            "Date":"03/18/19",
            "MessageLine":"",
            "PayRateLevel":"",
            "WageCode":"",
            "UnionCode":"",
            "WorkersComp":"",
            "StateTaxCode":"",
            "CountyTaxCode":"",
            "LocalTaxCode":"",
            "EquipmentCode":"0749",
            "Equipmenthours":"",
            "Quantity":"",
            "CompanyCode":"",
            "PayRate":"",
            "EquipmentCostCategory":"3650",
            "CrewNumber":"",
            "CostCenter":"",
            "WorkOrder":"",
            "SiteEquipment":"",
            "Sitecomponent":"",
            "Contract":"",
            "EquipmentWorkOrder":"161025",
            "BillingCode":"",
            "BillingRate":""
         },
         {  
            "BatchCode":"CL20",
            "EmployeeCode":"28907",
            "Department":6160,
            "PayType":"R",
            "regularhours":7.0,
            "Job":"",
            "Phase":"",
            "CostType":"",
            "Date":"03/19/19",
            "MessageLine":"",
            "PayRateLevel":"",
            "WageCode":"",
            "UnionCode":"",
            "WorkersComp":"",
            "StateTaxCode":"",
            "CountyTaxCode":"",
            "LocalTaxCode":"",
            "EquipmentCode":"0749",
            "Equipmenthours":"",
            "Quantity":"",
            "CompanyCode":"",
            "PayRate":"",
            "EquipmentCostCategory":"3650",
            "CrewNumber":"",
            "CostCenter":"",
            "WorkOrder":"",
            "SiteEquipment":"",
            "Sitecomponent":"",
            "Contract":"",
            "EquipmentWorkOrder":"161025",
            "BillingCode":"",
            "BillingRate":""
         }
      ]
   }
}
In the 'Compse' action is the Json you have provided.
Capture13.PNGCapture14.PNG

Best Regards,

Community Support Team _ Zhongys

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
v-zhos-msft
Solution Sage
Solution Sage

Hi @SPOFLOW ,

I sugget you add a 'Compose' action to check the output of the Table1, make sure the output is an array.

I have made a test with the json you have provided.

{  
   "body":{  
      "Table1":[  
         {  
            "BatchCode":"CL20",
            "EmployeeCode":"28907",
            "Department":6160,
            "PayType":"R",
            "regularhours":9.0,
            "Job":"",
            "Phase":"",
            "CostType":"",
            "Date":"03/18/19",
            "MessageLine":"",
            "PayRateLevel":"",
            "WageCode":"",
            "UnionCode":"",
            "WorkersComp":"",
            "StateTaxCode":"",
            "CountyTaxCode":"",
            "LocalTaxCode":"",
            "EquipmentCode":"0242",
            "Equipmenthours":"",
            "Quantity":"",
            "CompanyCode":"",
            "PayRate":"",
            "EquipmentCostCategory":"6050",
            "CrewNumber":"",
            "CostCenter":"",
            "WorkOrder":"",
            "SiteEquipment":"",
            "Sitecomponent":"",
            "Contract":"",
            "EquipmentWorkOrder":"161121",
            "BillingCode":"",
            "BillingRate":""
         },
         {  
            "BatchCode":"CL20",
            "EmployeeCode":"28907",
            "Department":6160,
            "PayType":"R",
            "regularhours":1.0,
            "Job":"",
            "Phase":"",
            "CostType":"",
            "Date":"03/18/19",
            "MessageLine":"",
            "PayRateLevel":"",
            "WageCode":"",
            "UnionCode":"",
            "WorkersComp":"",
            "StateTaxCode":"",
            "CountyTaxCode":"",
            "LocalTaxCode":"",
            "EquipmentCode":"8040",
            "Equipmenthours":"",
            "Quantity":"",
            "CompanyCode":"",
            "PayRate":"",
            "EquipmentCostCategory":"4250",
            "CrewNumber":"",
            "CostCenter":"",
            "WorkOrder":"",
            "SiteEquipment":"",
            "Sitecomponent":"",
            "Contract":"",
            "EquipmentWorkOrder":"160453",
            "BillingCode":"",
            "BillingRate":""
         },
         {  
            "BatchCode":"CL20",
            "EmployeeCode":"28907",
            "Department":6160,
            "PayType":"R",
            "regularhours":2.0,
            "Job":"",
            "Phase":"",
            "CostType":"",
            "Date":"03/18/19",
            "MessageLine":"",
            "PayRateLevel":"",
            "WageCode":"",
            "UnionCode":"",
            "WorkersComp":"",
            "StateTaxCode":"",
            "CountyTaxCode":"",
            "LocalTaxCode":"",
            "EquipmentCode":"0749",
            "Equipmenthours":"",
            "Quantity":"",
            "CompanyCode":"",
            "PayRate":"",
            "EquipmentCostCategory":"3650",
            "CrewNumber":"",
            "CostCenter":"",
            "WorkOrder":"",
            "SiteEquipment":"",
            "Sitecomponent":"",
            "Contract":"",
            "EquipmentWorkOrder":"161025",
            "BillingCode":"",
            "BillingRate":""
         },
         {  
            "BatchCode":"CL20",
            "EmployeeCode":"28907",
            "Department":6160,
            "PayType":"R",
            "regularhours":7.0,
            "Job":"",
            "Phase":"",
            "CostType":"",
            "Date":"03/19/19",
            "MessageLine":"",
            "PayRateLevel":"",
            "WageCode":"",
            "UnionCode":"",
            "WorkersComp":"",
            "StateTaxCode":"",
            "CountyTaxCode":"",
            "LocalTaxCode":"",
            "EquipmentCode":"0749",
            "Equipmenthours":"",
            "Quantity":"",
            "CompanyCode":"",
            "PayRate":"",
            "EquipmentCostCategory":"3650",
            "CrewNumber":"",
            "CostCenter":"",
            "WorkOrder":"",
            "SiteEquipment":"",
            "Sitecomponent":"",
            "Contract":"",
            "EquipmentWorkOrder":"161025",
            "BillingCode":"",
            "BillingRate":""
         }
      ]
   }
}
In the 'Compse' action is the Json you have provided.
Capture13.PNGCapture14.PNG

Best Regards,

Community Support Team _ Zhongys

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

I did as you suggested and added a compose.  my options from the parse json were numerous. 

123.PNG

I thought choosing table1 would give me the results i wanted. However, I get no  results from it or "body". "Body" ,on the other hand, gives me this:

456.PNG

of course it fails when i try to put it to csv.  I'm at a loss.  not sure what to do at this point.

 

I figured it out but had to run it thorugh twice!

789.PNG

Thank you for your help.

Helpful resources

Announcements
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Difinity Conference 2022

Difinity Conference 2022

Register today for two amazing days of learning, featuring intensive learning sessions across multiple tracks, led by engaging and dynamic experts.

European SharePoint Conference

European SharePoint Conference

The European SharePoint Conference returns live and in-person November 28-December 1 with 4 Microsoft Keynotes, 9 Tutorials, and 120 Sessions.

Users online (1,620)