Dear all,
I have an input file which contain 3 variables information which are :-
1- Price
2- Barcode
3- Quantity
as shown in the picture below:
I have a total of these three variables 82 rows. What I'm looking for is to create a workflow that take each row and generate it in the JSON file as below, the red colored must be duplicated 82 times and changing the variables as per the variables file :-
Any help in that please?
I have attached the variables file.
Solved! Go to Solution.
@PhilipMannering Many thanks for helping! But I have a problen the sequence should be like that barcode, price, quantity and all small letter. Also the bracket [ after items should be removed and the code should be as shown below:
"items": [
{
"barcode": "100010001",
"price": 48,
"quantity": 107
},
{
"barcode": "100010002",
"price": 48,
"quantity": 124
},
{
"barcode": "100010003",
"price": 48,
"quantity": 58
},
{
"barcode": "100010004",
"price": 48,
"quantity": 82
},
{
"barcode": "100010005",
"price": 48,
"quantity": 89
},
{
"barcode": "100010006",
"price": 48,
"quantity": 124
},
{
"barcode": "100010007",
"price": 48,
"quantity": 70
},
{
"barcode": "100010008",
"price": 48,
"quantity": 77
},
{
"barcode": "100010009",
"price": 48,
"quantity": 140
},
{
"barcode": "100010010",
"price": 48,
"quantity": 119
},
{
"barcode": "100010011",
"price": 48,
"quantity": 45
},
{
"barcode": "100010012",
"price": 48,
"quantity": 71
},
{
"barcode": "100010013",
"price": 48,
"quantity": 175
},
{
"barcode": "100010014",
"price": 48,
"quantity": 112
},
{
"barcode": "100010015",
"price": 48,
"quantity": 41
},
{
"barcode": "100010016",
"price": 48,
"quantity": 57
},
{
"barcode": "100010017",
"price": 48,
"quantity": 101
},
{
"barcode": "100010018",
"price": 48,
"quantity": 119
},
{
"barcode": "100010019",
"price": 48,
"quantity": 76
},
{
"barcode": "100010020",
"price": 48,
"quantity": 67
},
{
"barcode": "100010021",
"price": 48,
"quantity": 132
},
{
"barcode": "100010022",
"price": 48,
"quantity": 68
},
{
"barcode": "100010023",
"price": 48,
"quantity": 53
},
{
"barcode": "100010024",
"price": 48,
"quantity": 75
},
{
"barcode": "100010025",
"price": 48,
"quantity": 50
},
{
"barcode": "100010026",
"price": 48,
"quantity": 126
},
{
"barcode": "100010027",
"price": 48,
"quantity": 52
},
{
"barcode": "100010028",
"price": 48,
"quantity": 87
},
{
"barcode": "100010029",
"price": 48,
"quantity": 110
},
{
"barcode": "100010030",
"price": 48,
"quantity": 60
},
{
"barcode": "100010031",
"price": 48,
"quantity": 53
},
{
"barcode": "100010032",
"price": 48,
"quantity": 86
},
{
"barcode": "100010033",
"price": 48,
"quantity": 140
},
{
"barcode": "100010034",
"price": 48,
"quantity": 78
},
{
"barcode": "100010035",
"price": 48,
"quantity": 59
},
{
"barcode": "100010036",
"price": 48,
"quantity": 28
},
{
"barcode": "100010037",
"price": 48,
"quantity": 72
},
{
"barcode": "100010038",
"price": 48,
"quantity": 94
},
{
"barcode": "100010039",
"price": 48,
"quantity": 44
},
{
"barcode": "100010040",
"price": 48,
"quantity": 55
},
{
"barcode": "100010041",
"price": 48,
"quantity": 231
}
],
Hi @Feras95p
I think this is more accurate (see attached). The only thing lacking possibly is the indentation. But it's should still be valid JSON. Let me know if it works.
Hi @PhilipMannering ,
How are you? I have you're doing well.
I modified the json file only but it's not getting output with my I don't know why! Can you help me?
I modified the code only to this one:-
Hi @PhilipMannering ,
Thanks for helping ! Unfortunately, it's not working ... Maybe because of the change in the JSON file.
What's not working? Can you share the exact output you expect? ... and then I'll just try and match that.
Hi @PhilipMannering ,
This is the output:
{
"skin": "weborder",
"establishmentId": 1,
"items": [
{
"barcode": "****",
"price": **,
"quantity": **
}
],
"orderInfo": {
"dining_option": 109,
"asap": true,
"customer": {
"phone": "0000011112",
"first_name": "",
"last_name": "Auto-poster",
"email": ""
},
"call_name": "Paid-Orders",
"call_number": 909080
},
"paymentInfo": {
"amount": "0.00",
"type": 7,
"transaction_id": "909080"
},
"discounts": [
{
"barcode": "MMD22",
"amount": **
}
]
}
@Feras95p Is this any different than this thread? I posted a solution there that seems to be very similar to this https://community.alteryx.com/t5/Alteryx-Designer-Discussions/Generate-rows-in-code/m-p/921523#M2251...