# Rick&Morty API tutorial : Where can I find the variable ID?

**URL:** <https://community.weweb.io/t/rick-morty-api-tutorial-where-can-i-find-the-variable-id/631>\
**Category:** Ask us anything\
**Created:** [June 4, 2022, 12:32pm UTC](https://community.weweb.io/t/rick-morty-api-tutorial-where-can-i-find-the-variable-id/631 "2022-06-04T12:32:37Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![JBDev](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/jbdev/32/701_2.png) [@JBDev](https://community.weweb.io/u/JBDev)\
**Post date:** [June 4, 2022, 12:32pm UTC](https://community.weweb.io/t/rick-morty-api-tutorial-where-can-i-find-the-variable-id/631/1 "2022-06-04T12:32:37Z")

</div>

Hi. Maybe it’s a newbie question, but I can’t see the variable ID as shown in the Rick&Morty API tutorial.  
Where can I find it now ?  
See image below.  
Thx for any help.

 ![image](https://us1.discourse-cdn.com/flex016/uploads/weweb/original/1X/5c5ffcbf50dd2c576adb792bca0bbbb2291877a7.jpeg)

---

<div class="post-metadata">

**Author:** ![Joyce](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/joyce/32/13232_2.png) [@Joyce](https://community.weweb.io/u/Joyce)\
**Post date:** [June 7, 2022, 9:23am UTC](https://community.weweb.io/t/rick-morty-api-tutorial-where-can-i-find-the-variable-id/631/2 "2022-06-07T09:23:28Z")

</div>

Hi @JBDev 👋

The Rick & Morty API tutorial was recorded before we made the variables available in the formula tab.

You can now find and bind the variables directly in the `var` tab:

 ![CleanShot 2022-06-07 at 11.20.58@2x](https://us1.discourse-cdn.com/flex016/uploads/weweb/original/1X/32f9b6f40ec12188cdb804d59fae4714cad6869a.png)

Or the `user` tab if the variable you are looking for is related to an authenticated user:

 ![CleanShot 2022-06-07 at 11.22.47@2x](https://us1.discourse-cdn.com/flex016/uploads/weweb/original/1X/ee3f8cdc46275a61aa8eb3284fc10a7b924a8d48.png)

Does that help?

---

<div class="post-metadata">

**Author:** ![JBDev](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/jbdev/32/701_2.png) [@JBDev](https://community.weweb.io/u/JBDev)\
**Post date:** [June 12, 2022, 1:21pm UTC](https://community.weweb.io/t/rick-morty-api-tutorial-where-can-i-find-the-variable-id/631/3 "2022-06-12T13:21:15Z")

</div>

Hi  
Thanks.  
Maybe a newbie question : can you just show me how to bind this “characterid” var in a query.  
Tried multiple ways, but the character data is not loaded in the queries down the line.  
Can’t replicate this timestamp in the video [Work with REST API data in WeWeb - YouTube](https://youtu.be/NW_D_AWp6Oo?t=314)  
thx

---

<div class="post-metadata">

**Author:** ![Joyce](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/joyce/32/13232_2.png) [@Joyce](https://community.weweb.io/u/Joyce)\
**Post date:** [June 13, 2022, 1:21pm UTC](https://community.weweb.io/t/rick-morty-api-tutorial-where-can-i-find-the-variable-id/631/4 "2022-06-13T13:21:37Z")

</div>

Sure!

Since the Rick & Morty API expects a URL with the character id ad the end, you’ll need to concatenate the URL path with the characterId variable at the end.

There are several ways you can do this.

1- Simply add a `+` sign in between the URL and the variable:

 ![CleanShot 2022-06-13 at 15.13.30@2x](https://us1.discourse-cdn.com/flex016/uploads/weweb/original/1X/2e613e0c5cce621dba1254db915faea128df2eaf.jpeg)

2- Use the `concatenate` formula to join the two:

 ![CleanShot 2022-06-13 at 15.17.54@2x](https://us1.discourse-cdn.com/flex016/uploads/weweb/original/1X/e3f9e512cb88bac44b0272c414b83185dcaa921f.jpeg)

If you hover over the `concatenate` formula (or any other no-code formula for that matter!), you’ll be able to see how it works:

 ![CleanShot 2022-06-13 at 15.18.40@2x](https://us1.discourse-cdn.com/flex016/uploads/weweb/original/1X/8377e53b4a628d9d289d4e7297775028aebcbb41.png)

Just remember to place the URL path in between quotes so the browser recognizes it’s a text (also called string).

You don’t need to place the characterId variable in between quotes because variables of type Query are automatically recognizes as strings:

 ![CleanShot 2022-06-13 at 15.20.39@2x](https://us1.discourse-cdn.com/flex016/uploads/weweb/original/1X/f6736b4e2a23b464a78d2a6f3c6ef272209bf53a.jpeg)

Does that make sense?

---

<div class="post-metadata">

**Author:** ![msq](https://avatars.discourse-cdn.com/v4/letter/m/8c91f0/32.png) [@msq](https://community.weweb.io/u/msq)\
**Post date:** [August 15, 2023, 11:01am UTC](https://community.weweb.io/t/rick-morty-api-tutorial-where-can-i-find-the-variable-id/631/5 "2023-08-15T11:01:52Z")

</div>

Hello Joyce,

I tried to do this tutorial but it doesn’t work. When I click on the collection item, it opens the page but not the correct associated item.

Can you help me please ?

Here is what I tried :

 ![Character-collection](https://us1.discourse-cdn.com/flex016/uploads/weweb/original/2X/9/9d46706782c946f1474c0936cc2cbb7f395c919e.jpeg)

I have also created a variable. The name of this variable is “characterid”, type : query, defaultvalue : 1

can you tell me where i made a mistake please ? thank you for your help

---

<div class="post-metadata">

**Author:** ![Joyce](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/joyce/32/13232_2.png) [@Joyce](https://community.weweb.io/u/Joyce)\
**Post date:** [August 16, 2023, 11:28pm UTC](https://community.weweb.io/t/rick-morty-api-tutorial-where-can-i-find-the-variable-id/631/6 "2023-08-16T23:28:40Z")

</div>

Hi @msq 👋

It looks like your API call is correct. A couple of things to check:

1. is your `character` collection refetched and up to date with the correct item?
2. does your workflow work if you test each action one after the other?
3. is the data on your item page bound to the `character` collection?

If not, maybe this video on how to [create a dynamic collection page](https://academy.weweb.io/scale-your-web-app/dynamic-pages/) can help.

Let me know!

---

<div class="post-metadata">

**Author:** ![msq](https://avatars.discourse-cdn.com/v4/letter/m/8c91f0/32.png) [@msq](https://community.weweb.io/u/msq)\
**Post date:** [August 18, 2023, 6:22pm UTC](https://community.weweb.io/t/rick-morty-api-tutorial-where-can-i-find-the-variable-id/631/7 "2023-08-18T18:22:14Z")

</div>

> [@Joyce](#):
>
> It looks like your API call is correct. A couple of things to check:
> 
> 1. is your `character` collection refetched and up to date with the correct item?
> 2. does your workflow work if you test each action one after the other?
> 3. is the data on your item page bound to the `character` collection?

Hello Joyce,

Ok thanks for the information. I saw your video (I chose option 2) and I made some changes but I still can’t get it.

Maybe if I add more images you will be able to see where I made a mistake ?

 ![character-collection](https://us1.discourse-cdn.com/flex016/uploads/weweb/original/2X/d/debb085fe37b77c2c0f8d69a729136f405f82c00.jpeg)  
 ![character-page](https://us1.discourse-cdn.com/flex016/uploads/weweb/original/2X/0/0915a81b655bdc2a39ac54ff88d7534629de78ca.jpeg)  
 ![characters-collection](https://us1.discourse-cdn.com/flex016/uploads/weweb/original/2X/2/2964b34db3f6d7effddb3ee669764b7433580f18.jpeg)  
 ![Collection-list](https://us1.discourse-cdn.com/flex016/uploads/weweb/original/2X/9/909bb0e3dbf7bbb5951df23cf0c573e1b2e45364.jpeg)  
 ![item1(homepage)](https://us1.discourse-cdn.com/flex016/uploads/weweb/original/2X/6/651913febad748390ee747c9ee6e439b4965488d.jpeg)  
 ![param(homepage)](https://us1.discourse-cdn.com/flex016/uploads/weweb/original/2X/4/48b8f34928dbbef454b3fc360da724ccffdf6293.jpeg)  
 ![url-path(character-page)](https://us1.discourse-cdn.com/flex016/uploads/weweb/original/2X/d/d13e5d19c265bf270b3a28f420c91693056f0f26.jpeg)  
 ![url-path(homepage)](https://us1.discourse-cdn.com/flex016/uploads/weweb/original/2X/1/1e682b1edeef21fe3f2300460895085d839f2910.jpeg)  
 ![Variable](https://us1.discourse-cdn.com/flex016/uploads/weweb/original/2X/c/c3de96b680d15fb8a95e1389b9bc67886dc89135.jpeg)

thank you

---

<div class="post-metadata">

**Author:** ![Joyce](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/joyce/32/13232_2.png) [@Joyce](https://community.weweb.io/u/Joyce)\
**Post date:** [August 22, 2023, 9:20am UTC](https://community.weweb.io/t/rick-morty-api-tutorial-where-can-i-find-the-variable-id/631/8 "2023-08-22T09:20:06Z")

</div>

Hi @msq 👋

Ok the issue is the following: it looks like you’re mixing the two approaches together.

If you choose option 2 in the video referenced above, you don’t need to create the `characterid` query variable. Instead you should bind the `character` collection to the `param` variable you have on your character page.

By the way, `param` is the name by default when you create the first parameter on a dynamic collection page but you can change it to whatever you want, maybe `characterid` in your case.

In order to bind the dynamic parameter of the collection page in your REST API collection:  
- make sure you’re on the character collection page  
- then go to your character collection  
- bind to the variable “From path in current page”

In the tutorial, it’s [this step](https://youtu.be/mLM8EY0Ub5w?t=682). In our example, the page parameter is called `ticket_id`:

 ![CleanShot 2023-08-22 at 11.18.52@2x](https://us1.discourse-cdn.com/flex016/uploads/weweb/original/2X/2/25dc42fd52f1e4c365a4aab28460c4385dfb393b.jpeg)

Does that help?

---

<div class="post-metadata">

**Author:** ![BertrandG](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/bertrandg/32/5129_2.png) [@BertrandG](https://community.weweb.io/u/BertrandG)\
**Post date:** [September 14, 2023, 5:06pm UTC](https://community.weweb.io/t/rick-morty-api-tutorial-where-can-i-find-the-variable-id/631/9 "2023-09-14T17:06:31Z")

</div>

Hello,  
I had the same issue (no id displayed) and found this page (BTW: such important changes should be mentioned in the video description and not in a reply to a comment). But whatever I do, I can’t figure out how to display the details for a person selected on the “characters” page. I followed the procedure for option 1 (+; with query string) first (didn’t work) but I don’t understand how to implement option 2 (concatenate). I just can’t find the UI options displayed in your sample screen which is also for a completely different project. Achieving the desired result is crucial since without implementing such a use case successfully WeWeb is useless for us.

---

<div class="post-metadata">

**Author:** ![BertrandG](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/bertrandg/32/5129_2.png) [@BertrandG](https://community.weweb.io/u/BertrandG)\
**Post date:** [September 21, 2023, 3:10pm UTC](https://community.weweb.io/t/rick-morty-api-tutorial-where-can-i-find-the-variable-id/631/10 "2023-09-21T15:10:51Z")

</div>

This tutorial seems to be outdated; WeWeb told me they will remove it. But I found another way achieving the desired result although I’m not sure if it’s the most efficient solution.

---

<div class="post-metadata">

**Author:** ![yassir](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/yassir/32/9116_2.png) [@yassir](https://community.weweb.io/u/yassir)\
**Post date:** [July 25, 2024, 6:57am UTC](https://community.weweb.io/t/rick-morty-api-tutorial-where-can-i-find-the-variable-id/631/11 "2024-07-25T06:57:36Z")

</div>

Hello Joyce,

First of all, thank you for your efforts ❤. I had the same issue as JBDEV, and I followed the tutorial using the concatenate technique. Initially, after testing, I still had Rick’s character, even after trying with other characters. I thought it wasn’t working, but then I had the idea to refresh the page (F5), and the expected character appeared.

My question is: Is this a bug in the editor, or am I not doing things correctly, or is it because I have a free account and my account is limited?
