Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Methods to retrieve CSV data as array or map #1141

Merged
merged 1 commit into from
Aug 15, 2024

Conversation

stuioco
Copy link
Contributor

@stuioco stuioco commented Aug 15, 2024

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
Copy link
Member

@tommysitu tommysitu left a comment

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
3 checks passed
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