You are viewing limited content. For full access, please sign in.

Question

Question

Testing Expression in Read JSON for Multivalue Token Does Not Seem to Work Correctly

asked on April 6

When using the Read JSON activity in Workflow and setting the multiple matches are found setting to "All matches (as a multi-value token)", the Result pane does not seem to display the results correctly. It always shows the results as a single result instead of breaking them into multiple values.

If I run an instance of the same workflow and use a Track Tokens activity, it shows that it has created the multiple values. So, it appears that the workflow executes correctly, but just that the testing of the expression within the activity doesn't work correctly.

I have tested this with Workflow 11.0.2306.898.

0 0

Replies

replied on April 7

Hi Blake, 

Could you provide more information on the sample data you've tested? I ran a test on 

[{"A": 1, "B": 2}, {"A": 3,"B": 3}]

with the JPath Expression 

$..A

Result was expected, 

1
3

Thanks

0 0
replied on April 8

Here is an example of how I am testing. Using the following JSON:

{
  "result": [
    {
      "number": "ABCD1234567",
      "id": "ef96c6e28314e25055c234234243",
      "total_cost": "2342",
      "vendor_name": "Acme Company",
      "vendor_number": "1234567",
      "business_unit": "4100",
      "currency": "USD",
      "approver_userid": null,
      "approver_user_email": null,
      "approver_user_domain": null,
      "gl_account_name": "Coyote",
      "gl_account_number_jde": "null",
      "gl_account_number_pdi_tempe": "1234-1234",
      "gl_account_number_pdi_toronto": "5678-56",
      "gl_account_number_pdi_laval": "7890-1234",
      "invoice_lines": [
        {
          "number": "INVLI0012345",
          "id": "0237a7a11b28e6d08e3d213asdfasdf",
          "total_cost": "25",
          "site": "1234567",
          "description": null,
          "covered_assets": [
            {
              "name": "Anvil",
              "cost_rate": "76"
            },
            {
              "name": "Anvil",
              "cost_rate": "24"
            }
          ]
        },
        {
          "number": "INVLI0068567",
          "id": "0337e7a11b28e6d08e3d2134563456",
          "total_cost": "28",
          "site": "8467836",
          "description": null,
          "covered_assets": [
            {
              "name": "Explosives",
              "cost_rate": "23"
            }
          ]
        }
      ]
    },
	{
      "number": "WXYZ9836476",
      "id": "ef96c6e28314e25055c2122342342",
      "total_cost": "9356",
      "vendor_name": "Acme Company",
      "vendor_number": "7395735",
      "business_unit": "3756",
      "currency": "USD",
      "approver_userid": null,
      "approver_user_email": null,
      "approver_user_domain": null,
      "gl_account_name": "Coyote",
      "gl_account_number_jde": "null",
      "gl_account_number_pdi_tempe": "1234-0456",
      "gl_account_number_pdi_toronto": "6456-37",
      "gl_account_number_pdi_laval": "1523-3495",
      "invoice_lines": [
        {
          "number": "INVLI0047628",
          "id": "0237a7a11b28e6d08e3d2223423422",
          "total_cost": "345",
          "site": "8374651",
          "description": null,
          "covered_assets": [
            {
              "name": "Explosives",
              "cost_rate": "23"
            },
            {
              "name": "Explosives",
              "cost_rate": "23"
            }
          ]
        },
        {
          "number": "INVLI0037264",
          "id": "0337e7a11b28e6d082342342",
          "total_cost": "34",
          "site": "2867356",
          "description": null,
          "covered_assets": [
            {
              "name": "Anvil",
              "cost_rate": "25"
            }
          ]
        }
      ]
    }
  ]
}

If I paste that into the Read JSON activity Test Input field, in the Result pane it does not show it as being multiple values like what you see when you test a Pattern Matching activity. In a Pattern Matching activity it breaks up each value by a small separator in the Result pane.

0 0
replied on April 10

What's the JPath expression you are using?

I could not reproduce the issue when using $.result[*].invoice_lines[*].number to extract all the numbers under invoice_lines node. 

0 0
replied on April 10 Show version history

I only used $.result[*]. Your result does not show each number as it's own value like it does when you use Pattern Matching. Pattern Matching shows a horizontal line between the values, so you know they are being detected as different values.

Here is an example of what it looks like when it detects multiple values for a Pattern Matching activity:

1 0
replied on April 11

Looks like the results box in Read JSON never got fixed to display multi-value tokens more clearly.

2 0
replied on April 11 Show version history

Yeah, it caused me a week's worth of headaches trying to troubleshoot why it was not seeing the values. Had some good friends that ended up actually running some test workflows and said it was working for them. We narrowed it down to me not actually running the workflow and only testing it in the activity itself.

0 0
replied on April 13

Hi Blake, 

Bug #586377 Make multivalue tokens displayed more clearly in Read JSON activity test input UI has been filed.

Thanks.

1 0
You are not allowed to follow up in this post.

Sign in to reply to this post.