Question

How do I split the Stripe fee test into two columns of Google Sheets in a specific order?

  • 26 September 2023
  • 10 replies
  • 58 views

Hey all!

I have two different customers, Customer A and Customer B.

Customer A their Stripe Fee test data is being displayed as this:

 



Customer B their Stripe Fee test data is being displayed as this:



Both are in a different order as you can see. This is annoying as I'm adding this Data to a Google Spreadsheet.

 

This is what I want to do:

Put application_fee in column 1 and put stripe_fee in column 2 next to each other in a Google Spreadsheet.

 

I'm splitting these two currently using Two Format Actions, (One called Application Fee and only picks the first part of the list, and second one is called Stripe Fee and picks the last part of the list) but this does not work for all payments because the order is different.

 

How can I make this work so that the order always stays the same? application_fee first and than stripe_fee.


Thank you for your help!


This post has been closed for comments. Please create a new post if you need help or have a question about this topic.

10 replies

Userlevel 7
Badge +14

Hi @julienvandorland 

Good question.

This can be handled via these options:

  • Formatter > Line Items > options
  • Code

Hey @Troy Tessalone 

Do you mean this with Line Items?

46abbee73d94c399db623de246aa8e85.png

Userlevel 7
Badge +14

@julienvandorland 

You’ll likely have to use custom Code in order to sort the items in an array.

 

Hey @Troy Tessalone 

Will have a look into your post. Thanks!

Hey @Troy Tessalone 

I got the data, and than split it into the first part and second part. Then Line Itemizer to add a property value of A and B to the parts but it doesn't seem to work. What am I missing here?

Tried removing .reverse() as well, but without any luck to sort them.

2973e3e011a86e7c432054d797e734cf.png

 

Userlevel 7
Badge +14

@julienvandorland 

1 Code step can be used to replace the 3 Formatter steps.

Userlevel 7
Badge +14

@julienvandorland 

Try asking ChatGPT for help with the custom code.

Hey @Troy Tessalone 

I asked Chatgpt for a solution, had some code to sort it but figure it wouldn't work for this.

 

So what I did was adding a conditional path. I check if it starts with the letter S, from stripe_fee, than I proceed to input the Data in my spreadsheet with stripe_fee first, and the other way around too.

Hey @Troy Tessalone 

Ok well, this makes no sense.

Why would it pass?

eac1bbcc98a571b26ec20bc0f0956b6d.png
 

Userlevel 7
Badge +14

@julienvandorland 

The value you are passing in on the left side is an array, not a string of text.

You can add a Formatter > Utilities > Line Items to Text step to flatten the array to be a string.