Adding Notion Image URL to a List in Loop

I am trying to fetch the image url form the notion database and storing it in a list called thumbnails[].
Here Is my approach:
image

When I am merging the thumbnails I get error (Recursive formula when assigning "thumbnail_list" is not allowed)
I am not able to add values to a list in loop.

what I am trying to achieve is to add the image URL I get from the notion database in the below code dynamically.-

Text Blaze Snippet
Copy to Text Blaze



defaultnonameBrain Damage on DTI Scans




https://fox-ae.com/wp-content/uploads/2023/12/INJ-Brain-Brain-Bleed-Hemorrhage-Demonstrative.jpgheight360width640








defaultnonameBrain Bleed




https://fox-ae.com/wp-content/uploads/2023/12/INJ-Brain-Brain-Bleed-Hemorrhage-Demonstrative.jpgheight360width640






Snippet preview

Hi @princy.jain9396 !

You are on the right track. Sadly, this is not supported in Text Blaze snippets by default. We're working on a new feature that should make this possible. It's in beta right now.

If you're interested to try it out, please email me at gaurang@blaze.today and we can setup the access for you.

Best,
Gaurang

Thanks for your quick reply but is their an alternative way to achieve it without using the beta version.

Without the beta version, you can do it like so:

{repeat: for id in ids; locals=thumbnails_full}
  {urlload: ...your urlload call...}
  {thumbnail=fromJSON(contents)[....]}
{endrepeat}
{thumbnails=map(thumbnails_full, x -> x["thumbnail"])}

Note the use of locals= setting on the repeat command to expose its inner variables into the outer scope in a single ordered list. You can read more about it here: Text Blaze | {repeat}

Thanks @Gaurang_Tandon It does solved the issue.

Please help me with an another issue
I am facing another issue, I am fetching the image URL from notion and storing, but while fetching the request I get error ("properties" is not in the list)

{urlload: .....]}
{ids=fromJSON(contents)["properties"]["Examples"]["relation"]}
{thumbnails=[]}
{repeat: for id in ids; locals=thumbnails_full} 
{=ids}
{urlload: .....]}
{thumbnail=fromJSON(content_image)["properties"]["Thumbnail"]["url"]}
{=thumbnail}
 {endrepeat} 
{thumbnails=map(thumbnails_full, x -> x["thumbnail"])}

My JSON Structure :

 "properties": {
        "⭐Fox Standard": {
            "id": "Chvt",
            "type": "checkbox",
            "checkbox": true
        },
        "Thumbnail": {
            "id": "DEEe",
            "type": "url",
            "url": "https://fox-ae.com/wp-content/uploads/2023/08/demonstrative-evidence.jpg"
        }
  }
  1. Can you check the URL that is being fetched and make sure it's the correct one?
  2. Make sure you give distinct names to the different variables in the Text Blaze snippet. Accidentally giving same names to different variables can cause conflicts.