Combine values into 1 new column

Hi

I am trying to combine 2 price values:
One column has sale price value, another column has original price value.
I want to put both in 1 new column, where the original price has a strikethrough.

Any thoughts on how I could achieve this?

Hi @Karl_Dreissen, :wave:

Try using the Add text column step. This step can create a new column using dynamic values from two or more columns. You can also add the <s> tag to create an HTML strikethrough.

{Sale Price} <s>{Original Price}<s>

What product are you using to list your prices? Shopify can use HTML for product descriptions and typically adds a strikethrough if both the “Price” and “Compared at price” values are present.

Just note, this isn’t universal across all e-commerce platforms, so let me know if you’re using a different platform, and can further investigate.

Thanks for explaining.

It should go into a Google Sheet and from there it is used in Glide app.

Other issue I am having now, is that I don’t want to display the ‘compare at price’ if it is empty.
Is that possible too?

In this case, it ultimately depends on how your Glide app is set up to ingest data from Google Sheets.

If you want to dynamically remove the column from your export, I recommend using the following steps:

  1. Add row numbers
  2. Unpivot columns
  3. Insert if/else column
  4. Filter rows
  5. Pivot columns

Use the Add row numbers step to create a temporary unique ID to help unpivot your data. To unpivot your data, use the Row Number column as your unique identifier column and pivot “All Rows except”.

Note: Do not add a column to pivot and be sure the Remove blanks toggle is unchecked.

From there, you can use the Insert if/else column step to create a “Target” column. If the type column contains compare_at_price (or something similar) and the value is blank, add the value “Remove”.

You can then filter out those columns, pivot the data, and clean up any columns that were created that we no longer need.

The final output will remove dynamically remove the compared at the column from your out if all of the values in that column are blank.

Let me know if this will work for your needs!