Dynamically populate path parameter from button click in list view component

  1. My goal:

I want to call a url, triggered from a button click, which has path parameters that need to be dynamically set from a list view component

  1. Issue:

When I try to access the url through this method :
PUT baseurl/admin/qualifications/{{ item.id }}/approve

The item.id is returned as null

  1. Steps I've taken to troubleshoot:

Gone through forum posts, tried different combinations such as current.id or selectedRow.id and item.id , nothing works

Sorry I am new to retool

  1. Additional info and problem in detail:

So basically the page is initally a table component, whose rows have a button, which on click opens up a modal, and on opening of the modal, a db query is triggered which loads up data

Now the data is loaded into a list component, and within the list component there is a button, now on the button click I want an api to be triggered, but a path parameter gets added to the url


This is the list view components details


This is a part of how the listview component looks like and its on the button click I want to trigger the call

This is the container inside the listViews data

PS I also have another button, which should trigger an api call, but a different one, but that also requires the path parameter to be dynamically added

Can someone tell me how to handle this, I am really confused

If any more info is required do let me know, ill provide them asap

Thank you

1 Like

Hi there @Madhav_Mohanakrishnan, and welcome to the forum!

Can you share where are you adding PUT baseurl/admin/qualifications/{{ item.id }}/approve is it a query that is being triggered by clicking on the button, or have you added it in a script as an event handler from the button?

Thanks
Miguel

Hi Miguel,

So I was initally running it as a query being triggered on button click, but on futher investigation inside the forums, I found out that we can use the run a script instead , this is how I ran it:

Thank you,
Madhav Mohanakrishnan

2 Likes

Thanks for sharing an update, @Madhav_Mohanakrishnan! I find that additionalScope is often underutilized, but it can be a really powerful tool. :+1:

2 Likes