Sorry, the InVision Help Center does not support Internet Explorer. Please download Microsoft Edge or another modern browser.


InVision ambassador ambassador
Amy Etheredge Amy Etheredge
closed thread

Duplicate JSON with Varied Length Content

Hey! First time user, so this might be something obvious.

I have a JSON file, something like so:

{
  "articles": [
    {
      "title": "hello, dear",
      "content" : "fancy much?"
    },
 
    {
      "title": "One More, Just for Kicks.",
      "content" : "Lorem ipsum dolor amet tousled air plant pop-up, literally YOLO dreamcatcher yr fingerstache portland. Vaporware migas palo santo tofu fixie, cray distillery messenger bag chia four loko gastropub. Trust fund keffiyeh chambray raclette, fam jean shorts swag waistcoat vaporware. Artisan chambray before they sold out raw denim, drinking vinegar taiyaki hot chicken aesthetic. Godard affogato cred scenester put a bird on it, narwhal DIY listicle pitchfork."
    }
  ]
}
 
I want to display my articles, so i set up the first one, link up the JSON for title/content, and then Duplicate using the Craft plugin.
 
The data gets duplicated alright, but the problem is that duplicate isn't accounting for variances in spacing. How would I solve this?
 
 
 
0

comments

sort by

official comment
Shaina Torgerson
InVision ambassador Shaina Torgerson, InVision Employee , ambassador
Comment actions Permalink

Hi Manikanta,

It appears as if this is a feature that our teams are still tracking interest for. I will update this thread once there are any changes to this feature request.

In the meantime, I will open a ticket on your behalf so that our Support team can track your interest for the JSON API auto-update feature mentioned in this thread. Please look for a message from our team soon.

Thanks,

Shaina

If anybody else would like to add their vote for this feature, please contact Support here and voice your opinion!


Shaina Torgerson
InVision ambassador Shaina Torgerson, InVision Employee , ambassador
Comment actions Permalink

Hi Amy,

Thanks for reaching out about this.

You are encountering this issue because we haven’t yet implemented the ability for Craft to handle variations in the length of text inserted from JSON & duplicated.

The good news is that we’re tracking interest regarding this feature! I'm going to open a ticket on your behalf so that you are alerted once this feature goes live. 

Hope this clears things up. Please feel free to reach out anytime with questions as you are getting acquainted with InVision!

Have a wonderful day,

Shaina

0

Amy Etheredge
InVision ambassador Amy Etheredge , ambassador
Comment actions Permalink

Oh... Interesting. Well that's a bummer. Real world data doesn't ever seem to be so....perfect. Thanks for opening a ticket for that, for sure!

In a different note/request, If I update my JSON, does it auto update in sketch (or can I force update somehow)? When I was trying to do so, it seemed like I would have to re-link/re-duplicate every time?

0

Shaina Torgerson
InVision ambassador Shaina Torgerson, InVision Employee , ambassador
Comment actions Permalink

Hi Amy,

Of course! Hope that helps you in the future.

Great question!

When you import a local JSON file into Sketch/Craft, it saves a link to a static copy of the JSON within your Sketch file. Currently, if the underlying JSON file is updated, in order to see those updates reflected in your document, you'd need to unlink your element from the JSON object in the old version of the JSON (via clicking the X next to the object), and then re-import the updated JSON into your document, and re-associate the element with the updated object. Here's a quick screen recording to demonstrate: https://www.dropbox.com/s/0ntjir8nrixxa42/updating-JSON-example.mov?dl=0

That said, we're sorry for the extra work or frustration this causes. Also note, having JSON updates also update the associated elements in the Sketch document real-time is indeed a potential feature that our Product team is tracking. They're monitoring interest and reviewing whether we should add this functionality to our product.

Please let me know if there's any other questions or concerns I can assist with!

Cheers,

Shaina

0

Amy Etheredge
InVision ambassador Amy Etheredge , ambassador
Comment actions Permalink

Ahhh. Yeah, that's a tough sell.

So... If this was served as an API, would that auto-update?

(Thanks for going the extra mile w/the video by the way, super helpful!)

0

Shaina Torgerson
InVision ambassador Shaina Torgerson, InVision Employee , ambassador
Comment actions Permalink

Hi Amy,

Tell me about it! Unfortunately, there isn't any way for either JSON or API content to auto update at the time.

However, I would be happy to open another ticket on your behalf to track interest in this feature.

Please let me know if there's anything else I can help you with.

Have a great day,

Shaina

0

Manikanta
InVision ambassador Manikanta , ambassador
Comment actions Permalink

Hi Shaina, 

Is there any news/update on the JSON api auto update feature. 

0

Arron Joseph
InVision ambassador Arron Joseph , ambassador
Comment actions Permalink

+1 on this ... would like to use JSON to populate symbols and it's just too buggy .. would be a game changer

0

Shaina Torgerson
InVision ambassador Shaina Torgerson, InVision Employee , ambassador
Comment actions Permalink

Hi Manikanta and Arron,

I have opened tickets on each of your behalf with our Support team so that they can track your interest for this feature. 

If anybody else would like to add their vote for this feature, please contact Support here and voice your opinion!

Thanks,

Shaina

0