In case you missed the announcement: The Alteryx One Fall Release is here! Learn more about the new features and capabilities here
ACT NOW: The Alteryx team will be retiring support for Community account recovery and Community email-change requests after December 31, 2025. Set up your security questions now so you can recover your account anytime, just log out and back in to get started. Learn more here
Start Free Trial

Alteryx Designer Desktop Discussions

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

Select tool - handle missing fields with default value

toral
6 - Meteoroid

Hi,

 

I have an iterative macro that receives json response, parses the same into csv and then outputs the selected fields. 

The response payload is a bit dynamic in the sense it won't return all the fields always. Like: 

{
     "elements": [
     {
         "type": "abc",
         "currentStatus": "Pending",
         "id": "12345",
         "city": "Chicago",
         "country": "United States"
}]}

 

and sometimes: 

{
     "elements": [
     {
         "type": "abc",
         "currentStatus": "Pending",
         "id": "8765",
         "country": "United States"
}]}

 

City is missing in the second response.

The select tool does not identify a field such as City and the final output csv structure changes from 5 fields to just 4.

The select tool says missing fields when the city field is not available. 

 

What's the best way to handle this. 

 

I want the output to be all the 5 fields 

 

Attached a snapshot of the workflow: 

 

macro.JPG

1 REPLY 1
toral
6 - Meteoroid

This was handled by adding a 0 record file (skeleton file) with the fields of interest. This skeleton merged with the select output gave the final consistent result as needed. 

Labels
Top Solution Authors