Question

Trying to pull data from "code by zapier" to JSON

  • 24 March 2020
  • 2 replies
  • 589 views

Hey Guys, 

NOT developer (mistake that can’t be undone), 

I’m trying to bundle a lot of responses and edit them to 1 value to be sent out as JSON.

I’ve created a code by zapier step that pulls this out:

I want to pull out the entire contents of “JSON” to be used as a JSON payload, something like this:

{
"dayOfWeek": "1",
"closed": false,
"MondayFrom1": "07:30",
"MondayTo1":"13:30",
"MondayFrom2":"12:30",
"MondayTo2":"13:30"
},
{
"dayOfWeek":"2",
"closed":"true"
},

{
"dayOfWeek":"3",
"closed":"false",

"WednesdayFrom1": "07:00",
"WednesdayTo1":"21:00",
}

 

But there is no “JSON” value, it just breaks it down to a million little fields (“json dayOfWeek”)

How can I solve that?

Thanks!


This topic has been closed for comments

2 replies

Userlevel 7
Badge +11

Hi @itainet this is the best category for your question as it’s not just for folks who are developing an app, but also for any more technical/code related questions!

 

Does anyone have any ideas about how to package the output of a code step into one JSON field, rather than pulling out all items in it as separate fields? @BowTieBots  or @ikbelkirasan I know that you’re both great with code, any ideas?

Userlevel 4
Badge +4

Hi @itainet,

Can you post a picture of the code step that’s creating that output?  I have some ideas of how to solve this but don’t want to speak too soon.

Thanks!