@Cizco
Users can only enter 1 food and/or drink in the Microsoft Form, and each response is represented by a new element in your sharepoint list, right? No way to ask for two yogurths in the same response.
AS far as I understand you already built the food dictionary, i.e. an array with all food items represented once. Let's assume you have stored the dictionary in a variable called 'FoodDictionary'
Once build, my suggestion is to add an Apply to each action block, Its input would be the variable 'FoodDictionary'.
variables('FoodDictionary')
Inside the Apply to each, you place a Filter Array action block. Its input would be the output obtained in Get Items action block
body(Get_items')?['value']
and the condition applying for the Filter Array would be:
equals(item()?['Frukost'],items('Apply_to_each'))
Please note I am assuming Frukost is defined in your Sharepoint List as a string based column. If it is either a Choice column, or a LookUp column, the expression would be slightly different.
Now you just need to count the number of elements matching the filter. Let's assume you add a Compose action block with the following expression:
concat('Food Item: ', items('Apply_to_each'), '.Nr of units ordered: ',length(body('Filter_array)))
You can append the result of each iteration in another array variable, remember this second variable shall also be initialized before the Apply to each. You can use this second array variable as a container of objects like the following:
{'Frukost': 'Yogurt', 'NrUnits': 2}
Please note I haven't tested myself the expressions yet, hope not to have included any typo
Hope this helps