Wrong syntax or wrong config?

Hello,

I am currently struggling with something I do not understand…

Context : I have two tables :

1 table named Track for Tracks with a field Play which is a List of Plays from the next table.
1 table named Play to log each time a track is played (timestamped) with a field Track which is a Track from the table above, a date field and a PlayCount field (1).

In a repeating group with data source Track, i have two text fields:

image

image

I get a proper result from the first text field but not from the second.

Could you explain what is wrong here?

Thank you very much in advance!!!

Philippe

@philippepailhe If you’re looking for just the count, have you tried:

Current cell’s Track’s Play’s PlayCount:count

That will return only 1 if it is not a list.
You only need: Current cell’s Track’s Play’s PlayCount

Hi there!
thanks for your reply!
count is ok, sure. But I don’t get the same results. I have for instance two plays in my db. The first field gives a proper 2 and the second field gives a 0…

I may have just read the post wrong, and correct me if I’m wrong, but shouldn’t the ‘PlayCount’ be a list of dates? So when searching for the Current cell’s Track’s Play’s PlayCount:count returns the number of plays for each track?

When adding a ‘timestamp’ to each track, it’ll be a simple:

PlayCount add Date/TimePicker A’s value

(or whichever the naming convention is) to the current track.

Hum… That’s not really the problem.
I do not understand why for instance:

Search for Plays’s PlayCount:sum (with a search constraint Track = Search for Tracks:first item)

and

Search for Tracks:first item’s Play’s PlayCount:sum

do not give the same result. For me, these are two ways of asking for the same thing… And I can’t see what is wrong.

Philippe

On the surface, this looks like the same way of asking for the same thing but the reality is that it can be two very different results.

A Play record that has a Track associated to it’s Track field does not mean the same Play record is in the Track’s list of Plays field.

If you have a workflow that Creates a new Play where Track=Track but forget the second workflow that 'Makes a change to the result of step 1's Track' and changes the field 'Play (list) add Result of Step 1's Play' then you wind up with a Play that will be found if you

But won’t be found if you

If you are getting different results from those two searches, check your workflows and make sure you haven’t missed updating both sides of the equation correctly when creating new plays.

As an aside, unless the PlayCount field will ever have a value different from 1, you could simplify your data a bit by simply doing a search for Plays:count rather than summing the PlayCount field.

The PlayCount field is redundant in this scenario as the existence of a Play record in itself counts as 1 item.

Hope this points you in the right direction

Hi Eli !

That was exactly my mistake !!
Thank you so much for taking the time to help me !

Philippe

1 Like