question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Is it possible to get the row count?

See original GitHub issue

Is there a way to get a row’s “count” when it’s not in the original JSON dataset?

Eg.

let fields = [ { label: "DES", value: "LNE", default: "LNE" },{ label: "Line Number", value: DATA HERE }]

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5

github_iconTop GitHub Comments

3reactions
juanjoDiazcommented, Oct 14, 2019

Just re-read your message. Do you actually want a counter for the lines?

You could do:

let counter = 1;
let fields = [
	{ label: "Line count", value: () => counter++ },
	{ label: "Buyer's Product Code", value: "product_id" },
	{ label: "Traded Unit GTIN", value: "sku", default: "sku" },
	{ label: "Description 1", value: "name" },
	{ label: "Pack Size", value: "", default: "1" },
	{ label: "Pack Quantity", value: "quantity", default: "quantity" }
];
0reactions
AndrewBarbercommented, Oct 15, 2019

Thats exactly what I was looking for with the counter. That was such a simple fix and I’ve been in a mess trying so many different things. Thank you so much for this!

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to count the number of rows in a table in SQL Server
The seemingly obvious way to get the count of rows from the table is to use the COUNT function. There are two common...
Read more >
4 Ways to Count Rows in SQL Server Table with Pros and Cons
This article will describe various ways to count the number of rows in a table of SQL Server to always choose the right...
Read more >
Getting Row Counts in MySQL (part 1) - Navicat
In today's tip, we'll use the native COUNT() function to retrieve the number of rows within one table or view within a MySQL...
Read more >
How to Count the Number of Rows in a Table in SQL
Use the COUNT aggregate function to count the number of rows in a table. This function takes the name of the column as...
Read more >
How To Get The Row Count Of a Pandas DataFrame
The third option you have when it comes to computing row counts in pandas is pandas.DataFrame.count() method that returns the count for non-NA...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found