Alteryx Designer Desktop Discussions

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

Building URL from Formula tool does not result in correct Download

calloni
9 - Comet

Hello all


New to Alteryx here and exploring the possibilities of the Input File+Formula+Download tool to get data from an API.

 

So I have this URL that calls the API I am interested on: https://publications.iadb.org/en/api/reports/publications/json?language=es&page=1

 

If I add this to a Text Input tool and hook it to a Download tool it works (I get the first of 5 pages of data). But I need to make the process dynamic so I split the URL in 3 parts and added to the Input tool

 

URL https://publications.iadb.org/en/api/reports/publications/json?

Language es

Page 1

 

Then I parsed this using the Formula tool like this:

 

[URL]+"language="+[Language]+"&page="+[Page]

 

Now when I run the procedure I am getting 11 pages. Those 11 pages happens also when I run the base URL of the API https://publications.iadb.org/en/api/reports/publications/json so I believe that something is not working well when I parse the API in the Formula tool.

 

The workflow is attached and any help is much appreciated in my start on this Alteryx journey.


Rodrigo

4 REPLIES 4
NickSm
Alteryx
Alteryx

Hey @calloni 

 

Took a quick look at the workflow.  Since you're using a Text input tool, Alteryx assumes the smallest possible field size for the String data type based on length. If you take a look at your Select tool you can see that the URL string is set to a size of 63, or your base URL, so that anything added by the Formula is truncated. If you change the String size to larger in the Select tool the correct language and page portions of the string are added and all works well.

 

clipboard_image_0.png

 

 

clipboard_image_1.png

 

 

fharper
12 - Quasar

@NickSm is right on...when using text input I usually do one of 2 things to insure I avoid this truncation, either use multi-field tool to resize..had a few oddities using Select in the past...or create a new field in formula which strings the various pieces together and downstream reference that field.

 

Note...if an App and the interface tool replaces the Text Input tool field value then the sizing in the meta-data will be dynamic to the replaced value which can be handy and preclude forcing the size per the prior discussion.

calloni
9 - Comet

Thanks so much Nick.

 

Those seems the kind of beginners trick that Alteryx have there just to make us use the Forums 🙂

 

Anyway, we keep learning, we keep Alteryxing 🙂

 

Rodrigo

fharper
12 - Quasar

@NickSm @calloni 

Also wanted to point out, since you sound new from your last Calloni...

watch the messages in output/results view ....  

 

the warnings people tend to ignore after a while and they can be very useful to let you know if you are truncating strings, numbers conversion errors etc.  I try to get rid of all warnings before I consider the job done...I have my flows logged, use logging option in system settings, and a job runs to look for errors and warnings and categorizes and counts and compares to a history stats file then adds to it...this tells me if I experienced a new issue or a recurring one and I can quickly assess if I need to address it and points me in the direction I need to go if I decide to pursue it.

 

Note: Unions and Joins will tend to throw warnings you can't get rid of so there you may choose the option to "Ignore" once you reviewed so that going forward it does not clutter the results.

 

Cudos to Nick for including the screen shot of the warning message... 

Labels