I have an Airtable database with Exercise names and corresponding images.
Now when a particular exercise name comes up on screen, I want to display that image from the Airtable.
Theoretically, I am looping through the ExerciseName column and when a match happens, display that corresponding row in ExerciseGIF column.
So I know how to get images from Airtable. If I specify the column and row, I am able to retrieve and display images. The following block is working since I know the exact row number.
However, my problem is about picking the image when the row number is dynamic. For example, when the name on screen is Squat, I should be able to retrieve the image of the Squat.
@thestrengthinstitute
Retrieve the column of exercises. Search through the returned list for the first occurrence of that exercise,
that is the row number
first
save the active exercise to a variable named tempActiveExercise
then
call airtable and get column ExerciseName, save this to a variable named allExerciseNames. now allExerciseNames is a list of all the cells (or exercises) in the column ExerciseName.
next
in list allExerciseNames, find the first occurence of tempActiveExercise
save this result to a variable named tempRowNumber
use tempRowNumber in your Airtable call to retrieve the image.
get cell
in row (tempRowNumber)
in column (“ExerciseGIF”)
However, I am not getting the picture on screen. Please help correct the blocks.
Susovan,
I think the problem might be that you are specifying the rowNum as a text string (i.e. "i"). It needs to be the variable named ‘i’ instead. Do do that you should pull the variable block from the “Variables” drawer on left side of the Blocks Editor and use that instead. It will look something like: