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
 WHAT’S NEXT AT MICROSOFT IGNITE 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Register for a Free Workshop.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

September Events 2022

Check out all of these events

Attend in person or online, there are incredible conferences and events happening all throughout the month of September.

Users online (2,077)