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
Power Automate News & Announcements

Power Automate News & Announcements

Keep up to date with current events and community announcements in the Power Automate community.

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.

Power Automate Community Blog

Power Automate Community Blog

Check out the latest Community Blog from the community!

Users online (2,767)