How to insert values in the same row

Hello again, sorry for another basic question :sweat_smile:

Im trying to add a new row to google sheets using the .csv module

but after the insert once value gets on one row and the second on a different row, how can I inser both on the same row?

thx in advance

You’ll have to combine the multiple bundles into a single bundle, so that they can be mapped in the same “Create a Row” module fields.

If you need further assistance, please provide the following:

1. Screenshots of module fields and filters

Please share screenshots of relevant module fields and filters in question? It would really help other community members to see what you’re looking at. You can upload images here using the Upload icon in the text editor.

2. Scenario blueprint

Please export the scenario blueprint file to allow others to view the mappings and settings. At the bottom of the scenario editor, you can click on the three dots to find the Export Blueprint menu item.

3. And most importantly, Input/Output bundles

Please provide the input and output bundles of the modules by running the scenario (or get from the scenario History tab), then click the white speech bubble on the top-right of each module and select “Download input/output bundles”.

Providing the input/output bundles will allow others to replicate what is going on in the scenario even if they do not use the external service.

Following these steps will allow others to assist you here. Thanks!

2 Likes

already tried the array / text / table aggregator but same result. not sure what module I should use to combine the bundles.

module-21-input-bundle.json (280 Bytes)
module-21-output-bundle.json (523 Bytes)
blueprint.json (28.0 KB)

@sehacencosasmx The approach you’re taking to solve the problem is wrong.
Because your integration is reading data from the array aggreagator one by one, and adding a new row for each collection in the array.
As i understand what you want to do is add the value to column B or column C based on the value ^XAGMXN or ^XAUMXN.
To avoid putting them on different rows, you need to check if the last row that has been filled has an empty column B or column C. If yes, then you use upate the row module to update only that column of the row. If No, then you use add a row to create a new row and fill the value.

A basic outline of the integration would be something like this:

  • You need to add a router after the parse csv module. Two path will be created from the router.
    One path will check with a filter if the col1 value is equal to ^XAGMXN. Another path will check if the value is ^XAUMXN

  • If the value matches ^XAGMXN, you want to add it to the column C. So you need to check first if the last row that contains some data in google sheet has an empty value in column C. If the last row has an empty column C, you simply update the row filling that column. But if it doesn’t have an empty value, it means you need add another row and fill the column.

  • The same approach goes for the second path of the router.

Now you may wonder how to find if the last row of a google sheet. You can use the search rows module of the google sheet and use a filter to check if the bundle number if equal to the total number of the bundles returned. That will be your last row. But this method may be a bit inefficient as it will need to iterate over all the bundles for each input.

A more efficient way would be to use Make data store where you save last the row number when you update or add a row.
Then you can simply get the row number from the data store and use it with the google sheet module. You may also need to modify the google sheet to add an index column so you can filter it based on the index number.

I’ve attached a screenshot of a scenario i created for you. It may be helpful for you to get the idea.

2 Likes

I really appreciate your time and help but I’m sure there must be a more simplified way.

If you find a simplified solution, do not forget to share it with us.
By the way, is the parse csv module always expected to have two bundles?

2 Likes

I ended up opting for a data store. I realized that I am going to need to combine data from another scenario so it was easier for me this way.

After getting the data from both scenarios, I created a 3rd scenario just with a module data store / get a record + add row google sheets and that’s it.

Once again ty for your time.

regards

2 Likes

Heya @sehacencosasmx :blob_wave:

Awesome to hear that you managed to come up with a simplified version of the scenario that caters to your needs. :clap:

Thanks for circling back to the community and sharing your final setup with the rest of us. This is super valuable and could be incredibly helpful to many others looking for a similar solution. :pray:

FYI: I marked your comment as a solution to keep the community organized and easy to look for answers.

1 Like