Hi all ![]()
I'm running in a dead end with my snippet ![]()
The situation: I have a Shopify bulk-edit table where I extract all 'ProductVariantTitleText' that contain the amount of adults and children. The output looks like that:
["Angthong Marine Park Full-Day Speed Boat VIP Tour - 10 / 0", "Angthong Marine Park Full-Day Speed Boat VIP Tour - 10 / 1", "Angthong Marine Park Full-Day Speed Boat VIP Tour - 10 / 2", "Angthong Marine Park Full-Day Speed Boat VIP Tour - 10 / 3", "Angthong Marine Park Full-Day Speed Boat VIP Tour - 10 / 4", "Angthong Marine Park Full-Day Speed Boat VIP Tour - 10 / 5", "Angthong Marine Park Full-Day Speed Boat VIP Tour - 10 / 6", "Angthong Marine Park Full-Day Speed Boat VIP Tour - 10 / 7", "Angthong Marine Park Full-Day Speed Boat VIP Tour - 10 / 8", "Angthong Marine Park Full-Day Speed Boat VIP Tour - 10 / 9", "Angthong Marine Park Full-Day Speed Boat VIP Tour - 10 / 10", "Angthong Marine Park Full-Day Speed Boat VIP Tour - 11 / 0", "Angthong Marine Park Full-Day Speed Boat VIP Tour - 11 / 1", "Angthong Marine Park Full-Day Speed Boat VIP Tour - 11 / 2", "Angthong Marine Park Full-Day Speed Boat VIP Tour - 11 / 3", "Angthong Marine Park Full-Day Speed Boat VIP Tour - 11 / 4", "Angthong Marine Park Full-Day Speed Boat VIP Tour - 11 / 5", "Angthong Marine Park Full-Day Speed Boat VIP Tour - 11 / 6", "Angthong Marine Park Full-Day Speed Boat VIP Tour - 11 / 7", "Angthong Marine Park Full-Day Speed Boat VIP Tour - 11 / 8", "Angthong Marine Park Full-Day Speed Boat VIP Tour - 11 / 9", "Angthong Marine Park Full-Day Speed Boat VIP Tour - 11 / 10", "Angthong Marine Park Full-Day Speed Boat VIP Tour - 12 / 0", "Angthong Marine Park Full-Day Speed Boat VIP Tour - 12 / 1", "Angthong Marine Park Full-Day Speed Boat VIP Tour - 12 / 2", "Angthong Marine Park Full-Day Speed Boat VIP Tour - 12 / 3", "Angthong Marine Park Full-Day Speed Boat VIP Tour - 12 / 4", "Angthong Marine Park Full-Day Speed Boat VIP Tour - 12 / 5", "Angthong Marine Park Full-Day Speed Boat VIP Tour - 12 / 6", "Angthong Marine Park Full-Day Speed Boat VIP Tour - 12 / 7", "Angthong Marine Park Full-Day Speed Boat VIP Tour - 12 / 8", "Angthong Marine Park Full-Day Speed Boat VIP Tour - 12 / 9", "Angthong Marine Park Full-Day Speed Boat VIP Tour - 12 / 10", "Angthong Marine Park Full-Day Speed Boat VIP Tour - 13 / 0", "Angthong Marine Park Full-Day Speed Boat VIP Tour - 13 / 8"]
Then I extract the amount of adults and children and count it with the correct price. So far so good and that's all work, but when I want to insert the results in the table, it first inserts the first amount, and then it inserts the second amount, but with the first total (18500), some empty space and then the correct total.
Unfortunately, the table will always use the first numbers, so it always inserts, 18500 for each line. I tried already many different ways, but nothing will work and since I don't have experience with Data Blaze, I'm not sure if I can get rid of it with Text Blaze or do I need Data Blaze because it's a table?
Thank you for any answer or idea!
{price_adult=1850}
{price_child=1450}
{product_text=catch({site: text; page=https://admin.shopify.com/store/; selector=._ProductVariantTitleText_gbwkp_6\ ; multiple=yes}, "")}
{if: islist(product_text)}
{repeat: for item in product_text}
{adults=catch(extractregex(item, "(\d+)\s/"), "0")}
{children=catch(extractregex(item, "/\s*(\d+)"), "0")}
{adult_total=adultsprice_adult}
{child_total=childrenprice_child}
{total=adult_total+child_total}
{=total}{key: enter}{endrepeat}
{else}{error: CHECK! Nothing found!}{endif}







