Error when evaluating ‘strategy’ for job in GitHub Actions

I trying to configure Key-Value Paris using GitHub Actions.

I have two workflow: Bulk-Config-KVM and Config-KVM.

Config-KVM can be used to configure one set that has multiple KVMs.

Bulk-Config-KVM is used for configuring multiple sets that has multiple KVMs.

Here is my input:
MapIdentifier11, Key11, Value11, Key12, Value12, Key13, Value13, Key14, Value14, true, MapIdentifier22, Key21, Value21, Key22, Value22, Key23, Value23, Key24, Value24, false, MapIdentifier33, Key31, Value31, Key32, Value32, Key33, Value33, Key34, Value34, false

I’m using Config-KVM as my re-useable workflow from Bulk-Config-KVM.

Config-KVM:

#Implementation of Config-KVM using GitHub Action
name: Config-KVM
on:
  workflow_dispatch:
    inputs:
      MapIdentifier:
        type: string
        description: 'Provide  name of KVM'
      Key1:
        type: string
        description: 'Provide  Key1'
      Value1:
        type: string
        description: 'Provide  Value1'
      Key2:
        type: string
        description: 'Provide  Key2'
      Value2:
        type: string
        description: 'Provide  Value2'
      Key3:
        type: string
        description: 'Provide  Key3'
      Value3:
        type: string
        description: 'Provide  Value3'
      Key4:
        type: string
        description: 'Provide  Key4'
      Value4:
        type: string
        description: 'Provide  Value4'
      Encrypted:
        type: choice
        options:
          - true
          - false
  workflow_call:     
    inputs:
      MapIdentifier:
        type: string
        description: 'Provide  name of KVM'
      Key1:
        type: string
        description: 'Provide  Key1'
      Value1:
        type: string
        description: 'Provide  Value1'
      Key2:
        type: string
        description: 'Provide  Key2'
      Value2:
        type: string
        description: 'Provide  Value2'
      Key3:
        type: string
        description: 'Provide  Key3'
      Value3:
        type: string
        description: 'Provide  Value3'
      Key4:
        type: string
        description: 'Provide  Key4'
      Value4:
        type: string
        description: 'Provide  Value4'
      Encrypted:
        type: string
   
jobs:
  Create_Update-KVM:
    runs-on: [xxx]
    steps:
      - name: Execute cURL
        run: |
          echo "### Key4 = ${{ inputs.Key4 }} ###"
          if [ ${{ inputs.Key4 }} != "" ];
          then
            createresponse=`curl -k --write-out '%{http_code}' --header "authorization: Basic ${{ secrets.USER }}" --header "Content-Type: application/json" --request POST --url 'https://example.com/keyvaluemaps' --data '{"encrypted": "${{ inputs.Encrypted }}","entry": [{"name": "${{ inputs.Key1 }}","value": "${{ inputs.Value1 }}"},{"name": "${{ inputs.Key2 }}","value": "${{ inputs.Value2 }}"},{"name": "${{ inputs.Key3 }}","value": "${{ inputs.Value3 }}"},{"name": "${{ inputs.Key4 }}","value": "${{ inputs.Value4 }}"}],"name": "${{ inputs.MapIdentifier }}"}'`
            
            if [[ $createresponse == *"201"* ]];
            then
              echo "KVM created successfully: $createresponse"
            else
              echo "Failed with $createresponse."
              exit 1
            fi

          elif [ ${{ inputs.Key3 }} != "" ];
          then
            createresponse=`curl -k --write-out '%{http_code}' --header "authorization: Basic ${{ secrets.USER }}" --header "Content-Type: application/json" --request POST --url 'https://example.com/keyvaluemaps' --data '{"encrypted": "${{ inputs.Encrypted }}","entry": [{"name": "${{ inputs.Key1 }}","value": "${{ inputs.Value1 }}"},{"name": "${{ inputs.Key2 }}","value": "${{ inputs.Value2 }}"},{"name": "${{ inputs.Key3 }}","value": "${{ inputs.Value3 }}"}],"name": "${{ inputs.MapIdentifier }}"}'`
            
            if [[ $createresponse == *"201"* ]];
            then
              echo "KVM created successfully: $createresponse"
            else
              echo "Failed with $createresponse."
              exit 1
            fi

          elif [ ${{ inputs.Key2 }} != "" ];
          then
            createresponse=`curl -k --write-out '%{http_code}' --header "authorization: Basic ${{ secrets.USER }}" --header "Content-Type: application/json" --request POST --url 'https://example.com/keyvaluemaps' --data '{"encrypted": "${{ inputs.Encrypted }}","entry": [{"name": "${{ inputs.Key1 }}","value": "${{ inputs.Value1 }}"},{"name": "${{ inputs.Key2 }}","value": "${{ inputs.Value2 }}"}],"name": "${{ inputs.MapIdentifier }}"}'`
            
            if [[ $createresponse == *"201"* ]];
            then
              echo "KVM created successfully: $createresponse"
            else
              echo "Failed with $createresponse"
              exit 1
            fi

          else
            createresponse=`curl -k --write-out '%{http_code}' --header "authorization: Basic ${{ secrets.USER }}" --header "Content-Type: application/json" --request POST --url 'https://example.com/keyvaluemaps' --data '{"encrypted": "${{ inputs.Encrypted }}","entry": [{"name": "${{ inputs.Key1 }}","value": "${{ inputs.Value1 }}"}],"name": "${{ inputs.MapIdentifier }}"}'`
            echo "### createresponse = $createresponse ###"
            if [[ $createresponse == *"201"* ]];
            then
              echo "KVM created successfully."
            else
              echo "KVM already exists: $createresponse"
              exit 1
            fi
          fi

In the Bulk-Config-KVM, I’m using Matrix as my strategy:

name: Bulk-Config-KVM.yml

on:
  workflow_dispatch:
    inputs:
      KVMs:
        type: string
        description: 'Provide the values in the following order MapIdentifier, Key1, Value1, Key2, Value2, Key3, Value3, Key4, Value4'

jobs:
  build:
    runs-on: [xxx]
    outputs:
      iterations: ${{ steps.set-iterations.outputs.values }}
    steps:
    - name: Start
      run: ls
    - name: Read JSON and trigger workflows
      id: set-iterations
      env:
        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
      run: |
        echo "Print Inputs provided by the user"
        echo "### KVMs = ${{ github.event.inputs.KVMs }} ###"

        echo "BEFORE"
        input="${{ github.event.inputs.KVMs }}"

        echo "### input = ${{ github.event.inputs.KVMs }} ###"
        echo "AFTER"

        # Remove spaces around commas and split the input string into an array
        IFS=', ' read -r -a arr <<< "$input"

        # Initialize variables
        json="["
        map=""
        encrypted=""
        keys=()
        values=()

        for ((i=0; i<${#arr[@]}; i++)); do
          if [[ ${arr[i]} == MapIdentifier* ]]; then
            if [ "$map" != "" ]; then
              json+="{"MapIdentifier":"$map","
              for ((j=0; j<${#keys[@]}; j++)); do
                json+=""${keys[j]}":"${values[j]}","
              done
              json+=""Encrypted":"$encrypted"},"
            fi
            map=${arr[i]}
            encrypted=""
            keys=()
            values=()
          elif [[ ${arr[i]} == true || ${arr[i]} == false ]]; then
            encrypted=${arr[i]}
          else
            keys+=(${arr[i]})
            i=$((i+1))
            values+=(${arr[i]})
          fi
        done

        # Add the last map
        json+="{"MapIdentifier":"$map","
        for ((j=0; j<${#keys[@]}; j++)); do
          json+=""${keys[j]}":"${values[j]}","
        done
        json+=""Encrypted":"$encrypted"}"

        json+="]"

        # Format the JSON
        echo $json | jq '.'

    - name: Check list
      run: |
        echo ${{ steps.set-iterations.outputs.values }}

  call-ASGW-Config-KVM:
    needs: [build]
    strategy:
      matrix: 
        iteration: ${{fromJson(needs.build.outputs.iterations)}}
    uses: ./.github/workflows/Config-KVM.yml
    secrets: inherit
    permissions:
      contents: read
    with: 
      MapIdentifier: ${{ matrix.iteration.MapIdentifier }}
      Key1: ${{ matrix.iteration.Key1 }}
      Value1: ${{ matrix.iteration.Value1 }}
      Key2: ${{ matrix.iteration.Key2 }}
      Value2: ${{ matrix.iteration.Value2 }}
      Key3: ${{ matrix.iteration.Key3 }}
      Value3: ${{ matrix.iteration.Value3 }}
      Key4: ${{ matrix.iteration.Key4 }}
      Value4: ${{ matrix.iteration.Value4 }}

  check:
    needs: [build]
    runs-on: [xxx]
    strategy:
      matrix: 
        iteration: ${{fromJson(needs.build.outputs.iterations)}}
    steps:
      - name: Do something
        run: |
          echo Iteration
          echo ${{ matrix.iteration }}
          echo ${{ matrix.iteration.MapIdentifier }}
          echo ${{ matrix.iteration.Key1 }}
          echo ${{ matrix.iteration.Value1 }}
          echo ${{ matrix.iteration.Key2 }}
          echo ${{ matrix.iteration.Value2 }}
          echo ${{ matrix.iteration.Key3 }}
          echo ${{ matrix.iteration.Value3 }}
          echo ${{ matrix.iteration.Key4 }}
          echo ${{ matrix.iteration.Value4 }}

Output of echo JSON is:

[
  {
    "MapIdentifier": "MapIdentifier11",
    "Key11": "Value11",
    "Key12": "Value12",
    "Key13": "Value13",
    "Key14": "Value14",
    "Encrypted": "true"
  },
  {
    "MapIdentifier": "MapIdentifier22",
    "Key21": "Value21",
    "Key22": "Value22",
    "Key23": "Value23",
    "Key24": "Value24",
    "Encrypted": "false"
  },
  {
    "MapIdentifier": "MapIdentifier33",
    "Key31": "Value31",
    "Key32": "Value32",
    "Key33": "Value33",
    "Key34": "Value34",
    "Encrypted": "false"
  }
]

Error: Error when evaluating 'strategy' for job 'check'. .github/workflows/Bulk-Config-KVM.yml (Line: 105, Col: 20): Error parsing fromJson,.github/workflows/Bulk-Config-KVM.yml (Line: 105, Col: 20): Error reading JToken from JsonReader. Path '', line 0, position 0.,.github/workflows/Bulk-Config-KVM.yml (Line: 105, Col: 20): Unexpected value ''

How to fix this and how to identify the right strategy for the different use cases?

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật