Action Buttons?
# 🤝help
a
in the carousal action button there is no way to put a variable with the button as my variable has my url in it which gets generated . there is not even a button option
a
Hey @adamant-barista-75132 what do you mean? Are you trying to pass a variable with the button's label, the button's URL, or the entire button itself?
a
yes variable
@acceptable-kangaroo-64719I am trying to pass in variable in action button i tried everything its not working also the carousal is not working on live embedded code idk why
a
Can you share the code and a screenshot of what you have tried so far?
a
the variable has the url in it

https://cdn.discordapp.com/attachments/1136974849131159613/1136978065906466877/Screen_Shot_2023-08-04_at_7.04.51_AM.png

Here i am trying to add my variable @workflow.response
i even tried in this format also not working

https://cdn.discordapp.com/attachments/1136974849131159613/1136978251777060975/Screen_Shot_2023-08-04_at_7.05.22_AM.png

And the carouasal is showing in the test mode but not on live shared link or embedding please check it thanks
a
So your second screenshot is how you can pass a var for carousel action buttons
the var needs to be an array of buttons. Let me try to find the schema for you...
here it is
Copy code
js
[
      {
        action: 'url',
        label: 'View Recipe',
        value: `your-url-from-api`
      }
]
a
Okay thanks and why is the carousel not working ok live sites
I can see images on the testing in the portal

https://cdn.discordapp.com/attachments/1136974849131159613/1137040166322720809/Screen_Shot_2023-08-04_at_11.11.37_AM.png

https://cdn.discordapp.com/attachments/1136974849131159613/1137040205401051217/Screen_Shot_2023-08-04_at_11.11.45_AM.png

it gives this error nothing has worked

https://cdn.discordapp.com/attachments/1136974849131159613/1137040398829760632/Screen_Shot_2023-08-04_at_11.12.17_AM.png

everytime it gives this error even if i put the variable as it contains the link
a
you need to define a workflow variable with that whole schema, you can't do it in the input box. 1. In an execute code card, put:
Copy code
js
workflow.myButtons = [
{
action:'url',
label:'Click me',
url:'www.google.com
}
]
2. In the action buttons part of the carousel, put
[{{workflow.myButtons}}]
a
okay i put this exact code there now it shows the button it nothing happens when i click i think i cant even click its not even going to google.com
please if you could help me out here its very important for me
a
ok turns out I missed an end quote and it isn't URL but value
Copy code
js
workflow.myButtons = [
{
action:'url',
label:'Click me',
value:'hhtp://www.google.com'
}]
also you don't need the [] when you add the var to the buttons

https://cdn.discordapp.com/attachments/1136974849131159613/1137060121806119082/image.png

a
Brother I did it is showing the label but when I click literally nothing happens
a
are you using "value" instead of "url"?
a
i tried both first the url google.com with http and then this

https://cdn.discordapp.com/attachments/1136974849131159613/1137062691517771886/Screen_Shot_2023-08-04_at_12.40.52_PM.png

https://cdn.discordapp.com/attachments/1136974849131159613/1137062737869029436/Screen_Shot_2023-08-04_at_12.41.18_PM.png

i get this but it does not work
a
line 5 change "url: workflow.response" to "value: workflow.response"
a
okay perfect it works but major issue is that when i have a noirmal action button there it executes in my website and i can see the carousal but with this i cant see it in my website
i can only see it on live
live testing

https://cdn.discordapp.com/attachments/1136974849131159613/1137063935833550888/Screen_Shot_2023-08-04_at_12.46.00_PM.png

a
sorry I'm not sure I understand what you're asking. You're saying that the carousel only renders on your live website and not in the emulator?
25 Views