dataliterate / data-populator

A plugin for Sketch and Adobe XD to populate your design mockups with meaningful data. Goodbye Lorem Ipsum. Hello JSON.
MIT License
1.67k stars 113 forks source link

Condition actions for #show/#hide not working #249

Open marklanham opened 3 years ago

marklanham commented 3 years ago

Which version of the plugin are you using? [ ] Data Populator for Sketch v3.6.2

Describe the bug I'm trying to show/hide a layer in Sketch using Data Populator but it doesn't work. I've tried naming the layer to #show["{user.for_hire}"] as the docs suggest but not having any luck. I've also tried making it a symbol but nothing works. These are the different names I've tried calling the layers:

show["{user.for_hire}"]

show["{for_hire}"]

show["{for_hire}" == true]

show["{user.for_hire == true}"]

show["{user.for_hire}" == true]

{#show["{user.for_hire}" == true]} [#show["{user.for_hire}" == true]]

No matter what, the layer is always showing even if the boolean value is set to false in the data. I tried manually hiding the layer to see if it would then show once set to true but it just remains hidden ā€” nothing I've tried works, have spent hours on this now.

I'm using the test datapopulator-demo.sketch template provided by Data Populator and I'm loading the data from this URL: https://api.unsplash.com/search/photos?client_id=80d96f3329e4b8a67d17ccec7571fef9b606b6d21f0fcd5f2191f84cc5cbf933&page=1&per_page=100&order_by=popular&query=sunset

Environment:

eaugustine commented 3 years ago

I've experienced this as well, though specifically it doesn't work in symbol instances. I can get it working if I've named the layer appropriately and directly "Populate Again" on the layer to test it out. But the moment I make the layer into a symbol and attempt to "Populate Again" an instance of the symbol, it doesn't work.

gustavneustadt commented 3 years ago

Experiencing the same here. Sketch Version 77 (131065)

Dirty fixed it with Detach from Symbol before populating with data. šŸ©¹

nitrada commented 3 years ago

sorry for the hassle, there are issues with conditional actions at the moment ā€“ especially with symbols.