Using the Lucid Extension API to fetch the URL response from a shape that "links to a web page"

  • 25 August 2023
  • 0 replies
  • 19 views

Userlevel 3
Badge +7

@john.a.lopez  asked about enhancing the shape Actions > Link to Web feature by building an extension that fetches a response from a linked URL and then uses this response to populate a property value for a Lucidchart shape. That's a great question and I thought I'd move it here to the Lucid for Developers Community space for discussion on how this can be done!


Can the URL set in an Action stored in the MapProxy.values and accessible via BlockProxy.allShapeData?


A property named 'Link' is returned by block.properties.get('Link') 
 

Does the URL need to be explicitly set as one of the shape's properties?


No the user doesn't need to define the URL in the custom shape data. The URL will be stored in the block properties as 'Link'so long as it is assigned to the shape's with shape Actions > Link to Web feature.

 

Finally once you have the URL then you can make a request to it using editorClient.xhr .or editorClient.oauthXhr to recover the response.

 

For detailed documentation please refer to the Lucid Editor Extension SDK and let us know in the thread below if you have any questions!


0 replies

Be the first to reply!

Reply