I want combine two arrays and two constant values to an single json object.
my Arrays:
arraywithperson=[Alfredo, James, John, Sarah, Vladimir ]
arraywithduration=[1,5,3,1,4]
variables:
start_date = Date.today
parent = 1
My Json Output should be:
{"data": [
{"person": "Alfredo", "start_date" = 22.01.2020, "duration": 1, "parent": "1"}
{"person": "James", "start_date" = 22.01.2020, "duration": 5, "parent": "1"}
{"person": "John", "start_date" = 22.01.2020, "duration": 3, "parent": "1"}
{"person": "Sarah", "start_date" = 22.01.2020, "duration": 1, "parent": "1"}
{"person": "Vladimir", "start_date" = 22.01.2020, "duration": 4, "parent": "1"}
]}
How can i combine the arrays with my variables that i can get this json output?