AIM
Hello and thanks for your help.
I receive a matrix values of a form.
I would like found texts from property “value”
In “value” each keys is rows id and values is columns id.
Rows are ranges of hours (in french)
Columns are days (in french)
{
"fields": [
{
"key": "question_5bz6qv",
"label": null,
"type": "MATRIX",
"value": {
"adcd6c71-b479-4568-a010-41a175dbd230": [
"418b937e-ad7c-40f6-8f9a-e53dd6f49b51"
],
"412ec996-897a-4c8a-b8d3-3e4e6d5bcdc2": [
"418b937e-ad7c-40f6-8f9a-e53dd6f49b51"
],
"78ea3ee2-1e6a-4665-abed-1ed4a01b2e38": [
"418b937e-ad7c-40f6-8f9a-e53dd6f49b51",
"734c781b-e67a-4703-a72d-df562755b856"
],
"00923fac-8576-4902-aa90-e0ccdc82b459": [
"418b937e-ad7c-40f6-8f9a-e53dd6f49b51"
]
},
"rows": [
{
"id": "01b1b787-1d8e-463d-ba59-3df704a33b38",
"text": "00h à 01h"
},
{
"id": "adcd6c71-b479-4568-a010-41a175dbd230",
"text": "01h à 02h"
},
{
"id": "412ec996-897a-4c8a-b8d3-3e4e6d5bcdc2",
"text": "02h à 03h"
},
{
"id": "78ea3ee2-1e6a-4665-abed-1ed4a01b2e38",
"text": "03h à 04h"
},
{
"id": "00923fac-8576-4902-aa90-e0ccdc82b459",
"text": "04h à 05h"
},
{
"id": "27a132dd-1c28-49f2-b0c7-e4f184be896b",
"text": "05h à 06h"
},
{
"id": "14d86c63-907c-496e-9d75-131d35544ca0",
"text": "06h à 07h"
},
{
"id": "5c2b8f0a-a80c-4a62-9655-d31d3902cc88",
"text": "07h à 08h"
},
{
"id": "e8d9ebfe-b5f6-4d31-bd63-411d2f8badab",
"text": "08h à 09h"
},
{
"id": "ab38b98f-9961-469f-bdf5-bdd102ba1843",
"text": "09h à 10h"
},
{
"id": "870db88a-dadb-4238-937c-18e67f80b21c",
"text": "10h à 11h"
},
{
"id": "63b79dff-875e-4884-a4af-af98f2b37c5d",
"text": "11h à 12h"
},
{
"id": "6ed1044c-fe64-41a0-abca-3d99574641e0",
"text": "12h à 13h"
},
{
"id": "e1d288af-0f1e-4446-9cef-11a819bbcb4e",
"text": "13h à 14h"
},
{
"id": "1f1d5ec3-fc78-4104-af6d-c4a1b10e056a",
"text": "14h à 15h"
},
{
"id": "b3fe7143-a6a1-4acd-aabf-8b9548e9d1a8",
"text": "15h à 16h"
},
{
"id": "67759a9d-c150-4ebf-be2c-52906069a931",
"text": "16h à 17h"
},
{
"id": "4ff05c4d-4f64-46c0-b09d-fd671dcfe713",
"text": "17h à 18h"
},
{
"id": "24dc196d-c084-48b7-967e-70ffab36f200",
"text": "18h à 19h"
},
{
"id": "40735a67-3103-47be-97d1-56010dc118d4",
"text": "19h à 20h"
},
{
"id": "3dcbe1e8-3241-46c0-aec3-b713ef34dd72",
"text": "20h à 21h"
},
{
"id": "69006192-dab9-46bd-abce-49c60969b17c",
"text": "21h à 22h"
},
{
"id": "479aafdb-b0a6-454e-b27a-0eea266436bd",
"text": "22h à 23h"
},
{
"id": "4db1f138-fc5d-47e5-91d4-49755a954902",
"text": "23h à 00h"
}
],
"columns": [
{
"id": "c723ec93-897e-43c5-9dcc-347e117c6936",
"text": "LUN"
},
{
"id": "734c781b-e67a-4703-a72d-df562755b856",
"text": "MAR"
},
{
"id": "418b937e-ad7c-40f6-8f9a-e53dd6f49b51",
"text": "MER"
},
{
"id": "fef9c5f9-b653-44f6-9988-129374a5c098",
"text": "JEU"
},
{
"id": "7970806b-e158-48c3-a207-8945cb1725d6",
"text": "VEN"
},
{
"id": "fee276eb-acde-4f72-9219-7bc1491c517a",
"text": "SAM"
},
{
"id": "d0d60d83-34c8-4165-8fc7-e709b4a6605b",
"text": "DIM"
}
]
}
]
}
Example
In this case, I need that :
Step 1
MER : [“01h à 02h”, “02h à 03h”,“03h à 04h”,“04h à 05h”]
MAR : [“03h à 04h”]
VEN: [“02h à 03h”,“03h à 04h”, “18h à 19h”, “19h à 20h”]
Step 2
Then, I want to merge range of hours
MER : [“01h to 5h”]
MAR : [“03h to 04h”]
VEN: [“02h to 04h”, “18h à 20h”]