Page 1 of 1

Enter space in a widget

Posted: 04 Dec 2015 14:25
by Mar
In the moment I'm developing a flow which checks periodically amazon's prices of some products. I store these prices in a map variable with some additional information.

global_amazon={www.amazon.de/product 1[name1, price1, merchant1], www.amazon.de/product2=[name2, price2, merchant2]}

Moreover, I have got an overlay which shows me the actual price. The widget extracts the prices of all products and store them in a local list. (list=[14,36, 25,68]). That's no problem. But now I am not able to show the prices with a added euro symbol at the end in multiple lines. So my widget should like:

price1€
price2€
price3€

I tried to paste a enter space so that the prices are in different lines but it causes an error. Additionally, all prices should be shown centrally. Is there a way to solve this?

Re: Enter space in a widget

Posted: 04 Dec 2015 20:30
by Martin
Hi,

You could use a script to concatenate the prices in a loop:

Code: Select all

list = newList(14, 36, 25, 68);
res = "";
for (p in list)
{
  res = res + p + "€\n";
}
setWidgetElementProperty("Widget1", "Text_1", "text", res);
The widget element has to be set to Multiline and Textalign to Center.

Regards,
Martin

Re: Enter space in a widget

Posted: 05 Dec 2015 00:11
by Mar
Thanks a lot, Martin!