Hi. Welcome to the community.
You can use a repeat step to traverse all the products returned in the first API step, and then add another API step inside the repeat.
In the new API step, you can use bindings shown under repeat in the picker to get the current product id, while it loops.
Remember to enable output for both API & Repeat to see results on client side.
the Text property has been linked to the serverconnect call, rathere than the element in the table’s repeat. It should just be stockid or stockLevel or whichever field you want to show in the cell. You shouldn’t have getProduct.data.query[0] (or something similar) at the start
@bpj Take it easy on the fellow Wappler with manual code. The pickers are much better now, so no need for manual code always. I would have suggested the same 6 months ago, but now I prefer the “visual way” for learners.
@evaluate When you open the picker to select binding for repeat, you need to select just until the items object. That’s an array and the repeat will run as many rows there are in items.
Next, when you select binding for the URL of API step, you should see in the picker the REPEAT step showing some options - select the sku/productid from there, and NOT the original API step.
This will basically give you what Ben is suggesting in the code.
Ok on Server Sice i got it to work now so that it shows me in console every stock per SKU without the variables! It was the false binding in my server side action. Thanks!!
But now i have the same problem with showing the Data in a Bootrstap 5 Table.
I selected one Cell and bind it to the stocklevel from the repeat action. Ist this wrong?
You just need to call the SC again on click of the refresh button… that will automatically update the data as per the bindings. No need to refresh the whole page. sc1.load()
As for spinners, there is a built-in component called page-loader of something.
That fires itself when a SC is loading I think. Or you can call it on demand as well.
I personally don’t use page-loaders, instead just a simple SPIN icon which shows when SC is executing. It looks something like: dmx-show="sc1.state.executing"
When you say items, I am assuming you are just after a bunch of IDs… and rest of the data like name, quantity etc can be retrieved on server side, if needed.
So, you simply need a multi-select select component on the client side. Or you can use tagify component.
Then on server side, you should get an array of selected items.