Post Requests
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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
Solved! Go to Solution.
- Labels:
- API
- Best Practices
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
@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........
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
@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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
@Luke_C you've really helped me out here, thank you so much!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
No problem, give it a shot and if you get stuck post an updated workflow. Creating JSON can be tricky
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
