Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

Post Requests

alteryxkev
7 - Meteor

Hi folks, 

 

I've been doing some work converting CSVs into JSON format but I've hit a problem, I'm attaching 3 files, my raw data from CSV, my alteryx flow, and the format I'd like the data to be in. 

 

The API call requires a set of square brackets, I've applied what I thought was the correct logic into my flow but as can be seen the JSON format only shows curly brackets. 

 

Additionally I'd also like to be able to include as many requests as necessary within my request, rather than applying them one at a time. 

 

**All data being shared is random and it isnt related to any clients I'm currently working with.**

 

Any help with this would be massively appreciated, I'm in a real jam! 

 

Kev 

 

 

11 REPLIES 11
Luke_C
17 - Castor

Hi @alteryxkev 

 

Can you confirm your desired format is correct? I don't see any closing square bracket. I think you'll also run into trouble in the 'balance' field since the desired format requires a numeric value but you are passing a string. I also see that mobile/email are supposed to be under address but you don't seem to have it setup for that, which is correct?

alteryxkev
7 - Meteor

Hi @Luke_C,

 

Oversight from my side, updated file attached. 

Luke_C
17 - Castor

Hi @alteryxkev 

 

This should do the trick, but if you're trying to process multiple records, which is what I suspect from this format, it may require some tweaking. Also cleaned up the giant if statement into a mapping table and addressed the data type item I noted.

 

 

alteryxkev
7 - Meteor

@Luke_C that has sorted that issue out data looks good, thank you! Since you've mentioned multiples, this is what I'm planning next........

Luke_C
17 - Castor

@alteryxkev That makes more sense with the layout. You'd use similar steps and end up with a row of JSON for each record. Then you would concatenate using a summarize tool and add the square brackets there. After that a formula tool can be used to append the 'items' portion.

alteryxkev
7 - Meteor

@Luke_C you've really helped me out here, thank you so much! 

Luke_C
17 - Castor

No problem, give it a shot and if you get stuck post an updated workflow. Creating JSON can be tricky

alteryxkev
7 - Meteor

Hi @Luke_C, really sorry to trouble you again, I feel like I'm getting nowhere fast, if you could have a look at what I'm attempting I'd really appreciate it. 

Luke_C
17 - Castor

Hi @alteryxkev 

 

How's something like this?

Luke_C_0-1653419417706.png

 

 

Labels