How to pass variable to Cards button

I'm creating a bot for product suggestion in Shopify. I was able to get the product details as variables such as product name, price and product link When i pass the variable to the cards, it is showing each product in separate cards automatically, but not able to pass the variables to the button, how to do that?
7 Replies
Baptiste
Baptiste4mo ago
Can you provide a reproduction? Or at least record your screen? What are you trying to achieve exactly?
helloryz
helloryz4mo ago
I think he wants each item in the list to appear on the button. So if it’s [“product A”, “product B” , “product C”], there will automatically be three buttons with each button displaying the specific product. Don’t think you can do that now.
mdharoonh200
mdharoonh200OP4mo ago
like this in the right side cards have a button (which I named it as View Product), but I am not sure how to pass value to that button. I can draw a line and connect it to next block, but the next block is not considering the variables
No description
mdharoonh200
mdharoonh200OP3mo ago
any help here is appreciated
Baptiste
Baptiste3mo ago
but the next block is not considering the variables
You need to save the selected card variable
Baptiste
Baptiste3mo ago
mdharoonh200
mdharoonh200OP3mo ago
Thanks, will try it Is it possible to add text to variable and show it as dynamic? For eg. I have {{products_amount}} in the card, which is a dynamic value, I want to show it as Rs.{{products_amount}} any help here is appreciated Solved this, by using Set Variable block and js - {{products_amount}}.map(p => "Rs. " + p)

Did you find this page helpful?