Convert KCAL value to double
Sour Patch Kids 3, Snickers 15, Atomic Fireballs 15, Candy Corn 30, Sweetarts 25
Bag
Bag
Last
Split data
Warn
Transpose DATA of the bag
Keep needed field
Value
ParseComplex
Warn
Value_Matched
Parse Data to get 2 coloumns (name and qty)
Parse:
([a-zA-Z\s]*)([0-9]*)
"Value"
True
True
True
False
False
False
False
False
False
upper
Remove whitespace...
"Candy"
True
True
True
False
False
False
False
False
True
lower
Modify Case of candy
Add for each Candy and Qty the value of KCAL
"Candy"
False
False
True
False
False
False
False
False
True
lower
Modify case of Candy name
Correct candy name of Atomic fireballs
Candy = if contains([Candy],'fireballs') then
'atomic fireballs'
else
[Candy]
en...
KCAL for each Candy based on the qty
Convert Qty to double
SUM of KCAL for the bag
C:\Users\BENOIT\AppData\Local\Temp\Engine_7408_fc2255d3c1e0466483a70ec0a10df6f7_\Engine_9500_417d0a64f87044d398ac9a55cf9f871e_.yxdb
Single
Profile
Get KCAL for each candy using API
95NwP3mmvwYXOerqUxWs4vYXNz2mWDT0i8iXP70q
https://api.nal.usda.gov/ndb/V2/reports?
type=b&format=json&api_key=
API Key and URL generic part
Snickers
45318373
Candy Corn
45214366
Tootsie Roll Pop
45157442
Sweetarts
45262886
Atmoic Fireballs
45213587
Chewy Sours
45245489
Sour Patch Kids
45164706
NDB Lookup
Candy
NDBO_URL
V_WString
1024
Empty
IF [RecordID]=0 then
[Row-1:NDBNO] + [NDBNO]
else
[Row-1:NDBO_URL] + [NDBNO]
endif
Multirow for building global URL part
IF [RecordID]=0 then
[Row-1:NDBNO] + [NDBNO]
else
[Row-1:NDBO...
Change type of NDBid field
Formula to build URL part for API
RecordID
0
Int32
6
0
Record ID for identifying each Candy
Last
1
get last part (including full URL)
Last 1
Select only URL to pass through API
Error
Add URL part with NDBID... to URL and KEY part
Build global URL
URL
String
65001
GET
Compose
2
600
API Query
DownloadData
JSON Splitting
Key
ToKeep
V_WString
256
Empty
if [Row-1:JSON_ValueString]='kcal' then
[JSON_ValueString]
else
''
endif
define new field to keep only KCAL info field
if [Row-1:JSON_ValueString]='kcal' then
[JSON_ValueString]
el...
!IsEmpty([ToKeep])
Simple
IsNotEmpty
ToKeep
True
fixed
2018-11-05 20:37:58
0
2018-11-05 20:37:58
2018-11-05 20:37:58
filter to keep only KCAL info field
!IsEmpty([ToKeep])
Add KCAL value to each candy name
Horizontal
Challenge_139=BRP