Message Boards Message Boards

How to search Nutrition labels with food names and grams in FormFunction?

Posted 1 year ago

As far as I know, this code should be used to generate a nutrition label based on a given amount of a specific food:

EntityInstance[refried beans, 200g]["NutritionLabel"]

I tried to include this option in the FormFunction function so that on a website generated with the Wolfram Language, nutrition labels could be displayed by searching for a specific food name with this code:

CloudDeploy[FormFunction[{"Food"->"Food"},{"Gram"-"Quantity"},
#Food["NutritionLabel"]#Gram["NutritionLabel"]&]]. 

Unfortunately, this doesn't work. How could this be solved? Thank you in advance for your help.

POSTED BY: Ferenc Lengyel
2 Replies

Crossposted here.

POSTED BY: Rohit Namjoshi

Thanks for your help!

POSTED BY: Ferenc Lengyel
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract