Increment total in serverconnect

Hi guys,

I am struggling with something that seems so simple please help :slight_smile:

I have a serverconnect with a repeat outputing this:

{
"repeat": [
{
"product_id": "3",
"date_start": "2024-09-13",
"date_end": "2024-09-20",
"qty": "2",
"nb_days": 8,
"custom": [
{
"price": 8
}
],
"total_price_product": 128
},
{
"product_id": "4",
"date_start": "2024-09-13",
"date_end": "2024-09-20",
"qty": "1",
"nb_days": 8,
"custom": [
{
"price": 15
}
],
"total_price_product": 120
}
]
}

I just want the to increment total_price_product. I have set a variable before anything else name total_price and g_total_price but then I don't understand how to increment it and get the value at the end.

Thank you

While the program cycles through the list of products, use a variable and add the total product price to it. Then use the end value as the total amount.

Thank you,

I really don't get it, could you please take a look at my screenshot and tell me where I am messing up?

PS: At the moment I have hardcoded my total to be able to move forward

Thank you!

If the total_price_product step gives the correct result, then the next step is to increment my_total with that amount, all within the repeat area.

Sorry Ben,

I really don't get it, would you have a visual example please?

  1. First Set Value has empty value, set it to 0
  2. First Set Value has typo ("totel_price" instead of "total_price", but it doesn't affect anything)
  3. Ensure your Set Value fff has global name g_total_price
  4. Set Value my_total = {{ g_total_price }}

Thank you, that was a tough one :slight_smile: