In Yahoo! Pipes how can I return a single value from a loop that's built with values from every item?

て烟熏妆下的殇ゞ 提交于 2019-12-08 00:42:29

问题


For example, I have a list of items and each item has a name. I want to build a single string that contains a comma-separated list of all the names. In most programming languages, I would loop over the items and append to a value outside the list/array. But, I can't figure out any combination of Yahoo! Pipes modules to do it. Maybe I'm missing something obvious, but I also find nothing relevant from Google.

How do I append loop item values to a single value outside the loop?

Or how can I return a single value from a loop that's built with values from every item?

Or what is the correct method to accomplish this in Pipes if it's neither of those?


回答1:


The best method I've come up with based on help from the Yahoo! group, is to use an Item Builder (item.string = default) --> Loop ( assign all to item.string ). Using another pipe inside the Loop to provide the values to concatenate was also very helpful.




回答2:


Unfortunately the modules available with Yahoo Pipes alone cannot perform the task you are aiming at. The only solution available currently is to use "web service" module to call an externally hosted script (say in PHP)... the entire pipe content will be sent to the script as POST field "data". You can code the script such that it loops through all items to add the string to a single string and return it after processing.



来源:https://stackoverflow.com/questions/7447931/in-yahoo-pipes-how-can-i-return-a-single-value-from-a-loop-thats-built-with-va

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!