Advertisement
Xabier-Clemente

JSON_parse.btin

Nov 30th, 2021
274
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.62 KB | None | 0 0
  1. <IntegrationFile Version="8" ID="e2d90a6c-0f11-490d-9d9e-24ac0f5829e5">
  2. <ActionGroup Name="IntegrationFileActionGroup" ID="e15a1813-36ef-4644-8f3e-54e15bab55f8" RunMethod="Sequential" MessagingEnabled="false">
  3. <Actions>
  4. <TimeScheduleIntegration Name="Time Schedule Integration" ID="a3d58a49-3166-4791-acb7-8eeb7ad9e79f" IgnoreErrors="true" ScheduleMethod="Immediately" StartTime="2020-07-10T00:00:00" RepeatEveryMilliseconds="0" RepeatDurationMilliseconds="0">
  5. <ActionGroup ID="43c81dc9-ad8e-475f-8409-184e5bccd566" RunMethod="Sequential" MessagingEnabled="false">
  6. <Actions>
  7. <SetVariableAction Name="Set testJson variable" ID="381a77f9-f93f-4b7a-a7cc-69d87b756803" IgnoreErrors="false">
  8. <VariableName>testJson</VariableName>
  9. <VariableValue>{&#xD;
  10. "Label": "Production Ticket",&#xD;
  11. "Printer": "Candy_E4305P",&#xD;
  12. "Copies": 1,&#xD;
  13. "Data": [{&#xD;
  14. "Number": "Test Item Number 1",&#xD;
  15. "CustomerNumber": "Test Customer Number 1",&#xD;
  16. "Name": "Test Description 1",&#xD;
  17. "Quantity": 1,&#xD;
  18. "CasePackSize": 1,&#xD;
  19. "Instructions": "Test Instructions 1",&#xD;
  20. "Notes": "Test Notes 1",&#xD;
  21. "Components": [{&#xD;
  22. "Number": "Test Component 1",&#xD;
  23. "Quantity": 5&#xD;
  24. }, {&#xD;
  25. "Number": "Test Component 2",&#xD;
  26. "Quantity": 2&#xD;
  27. }]&#xD;
  28. }, {&#xD;
  29. "Number": "Test Item Number 2",&#xD;
  30. "CustomerNumber": "Test Customer Number 2",&#xD;
  31. "Name": "Test Description 1",&#xD;
  32. "Quantity": 1,&#xD;
  33. "CasePackSize": 1,&#xD;
  34. "Instructions": "Test Instructions 2",&#xD;
  35. "Notes": "Test Notes 2",&#xD;
  36. "Components": [{&#xD;
  37. "Number": "Test Component 2",&#xD;
  38. "Quantity": 5&#xD;
  39. }, {&#xD;
  40. "Number": "Test Component 2",&#xD;
  41. "Quantity": 2&#xD;
  42. }]&#xD;
  43. }]&#xD;
  44. }</VariableValue>
  45. </SetVariableAction>
  46. <ForLoopActionGroup Name="For Loop" ID="a7872e9e-1216-47e7-9b15-368bf3ef7b6f" RunMethod="Sequential" MessagingEnabled="false" LoopVariable="data_index" StartValue="0" EndValue="&lt;%JSON.parse(testJson).Data.length - 1%&gt;" IterationValue="1">
  47. <Actions>
  48. <SetVariableAction Name="Get an element from Data array" ID="5d0efdb4-dfe0-426f-9c0d-338147d4016c" IgnoreErrors="false">
  49. <VariableName>Data</VariableName>
  50. <VariableValue>&lt;%;&#xD;
  51. var elem = JSON.parse(testJson).Data[data_index];&#xD;
  52. JSON.stringify(elem)&#xD;
  53. ;%&gt;</VariableValue>
  54. </SetVariableAction>
  55. <WriteMessageToLogAction Name="Whatever" ID="f6ac6645-d056-4e7b-b5d3-ef160ece19de" IgnoreErrors="false" Level="Info">
  56. <Message>
  57. <Value>%Data%</Value>
  58. </Message>
  59. </WriteMessageToLogAction>
  60. </Actions>
  61. </ForLoopActionGroup>
  62. </Actions>
  63. </ActionGroup>
  64. <DaysOfMonth>
  65. <int>31</int>
  66. </DaysOfMonth>
  67. </TimeScheduleIntegration>
  68. </Actions>
  69. </ActionGroup>
  70. <Metadata>
  71. <Properties>
  72. <Properties Name="MostRecentlyUsedVariables" Type="System.String">
  73. <Value>EventData</Value>
  74. </Properties>
  75. <Properties Name="SelectedDeploymentConfiguration" Type="System.String">
  76. <Value>Custom</Value>
  77. </Properties>
  78. <Properties Name="SelectedIntegration" Type="System.Int32">
  79. <Value>0</Value>
  80. </Properties>
  81. <Properties Name="SelectedOptionsPage" Type="System.String">
  82. <Value>1;1;0</Value>
  83. </Properties>
  84. </Properties>
  85. </Metadata>
  86. <SourcePath>D:\JIRA\REQ\1731_Parse Nested JSON\JSON_parse.btin</SourcePath>
  87. <IsPrinting>false</IsPrinting>
  88. <IsPrintPreview>false</IsPrintPreview>
  89. <DeploymentConfigurations>
  90. <DeploymentConfiguration CancelIfIntegrationFileExistsOnTargetServer="false">
  91. <Name>Test</Name>
  92. <TargetServers>
  93. <TargetServer Name="This Computer" Description="" IsServerGroup="false" />
  94. </TargetServers>
  95. <DeploymentSchedule Method="Immediately" />
  96. </DeploymentConfiguration>
  97. <DeploymentConfiguration CancelIfIntegrationFileExistsOnTargetServer="false">
  98. <Name>Production</Name>
  99. <TargetServers>
  100. <TargetServer Name="This Computer" Description="" IsServerGroup="false" />
  101. </TargetServers>
  102. <DeploymentSchedule Method="OnSpecifiedDate" />
  103. </DeploymentConfiguration>
  104. </DeploymentConfigurations>
  105. </IntegrationFile>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement