Skip to content

Methods to retrieve CSV data as array or map#1141

Merged
tommysitu merged 1 commit into
SpectoLabs:masterfrom
stuioco:csv-as-array
Aug 15, 2024
Merged

Methods to retrieve CSV data as array or map#1141
tommysitu merged 1 commit into
SpectoLabs:masterfrom
stuioco:csv-as-array

Conversation

@stuioco

@stuioco stuioco commented Aug 15, 2024

Copy link
Copy Markdown
Contributor

Hi!

I added three methods to make iterating over CSV data possible from templating.

  • csvAsMap - returns an array of maps of string representing the data in the CSV which makes this.fieldname possible: within an each block
  • csvMatchingRows - is the same thing but filters records based on a fieldvalue and field to match
  • csvAsArray - just returns the whole thing as an array of arrays of string.

I also changed the name of the previous parseCSV to fetchSingleFieldCSV (to be more descriptive given these new ones.)
I have not updated the documentation. Will do so once you've reviewed.

@stuioco stuioco requested a review from tommysitu August 15, 2024 14:30

@tommysitu tommysitu left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@tommysitu tommysitu merged commit 6a5dd9c into SpectoLabs:master Aug 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants