In a table I am working on, I list a couple of access tokes that can already exist or not. There are three relevant fields for my question:
Valid Until: If the user already has an access token, the current end-date is shown here
Start date: the start date is always today, as a new card would be made today
End date: this is where it gets tricky. If there is no Valid Until value, I want the end date to be one year from the start date, otherwise I want it to be one year from the valid until date.
To do this, I would like to access the until date in the row but I cannot seem to access currentRow in the mapped values for end date. (Valid until is looked up via a short script and an api call, so I would like to refer from using that api call multiple times)
Right now my mapped value for end date looks like this:
In your situation the best course of action to prevent duplicate code would be to add those external values to the datasource of the table, that way you would have validUntil as a property of currentSourceRow, which you could then use in end date mapped value.
You can add apicall data in the datasource of the table with JS or in the original data source by using the transform results tab (if it's a sql or api call).
Without more info, I agree with @GuilhermeSilva's suggestion. It would be helpful to collect as much of the data as possible at once and pass it into the data source
Thank you for your response but sadly I work with an external API and i cannot just add information to their data, otherwise that would be my solution as well. Right now I still do it with the different API calls.
I sadly cannot share a json of the app itself because it holds sensitive information. My main question is just why I cannot access currentRow in that mapped value, only currentSourceRow seems to come up.