Posts

Showing posts with the label Lightning

Upload file from Flow Screen - Salesforce

Image
Hello Trailblazers, Today I am going to explain how we can upload a file using salesforce flows. Recently salesforce has introduced an input component – File Upload, with the help of which we can upload files as well through screen in flows.  Before using File Upload component, let’s understand some properties to configure this component. To set these attributes we can enter simple text value or create resources or use flow constants. Attribute    Description  Accepted Formats  This attribute specifies the list of file types that would be accepted as input. This value should be text field with multiple extensions separated by comma. Example – ‘.docx,.pdf,.pptx’  Allow Multiple Files  If this attribute is set True then multiple file upload will be enabled. Use global constants here.  API Name  API Name for component.  Disabled  Whether to keep component disabled or not.  File Upload Label Information tex...

Salesforce Lightning empAPI Module - Test Platform, CDC Events

Image
  Hello Trailblazers, In this blog I have explained use of EMP API which is used to subscribe for events. You can create Lightning Component which uses this EMP API for subscribing to various streaming channels such as Platform Events, Change Data Capture Events, Generic Events. We can use this implementation for testing Platform Events or Change Data Capture events in local environment. Lightning/empApi module has below methods which are used for implementing events subscription.  Method Name    Parameter Name  Description  subscribe    Subscribes to the streaming channel, this gives subscription object which we use to unsubscribe later.    onMessageCallback  Callback function which is invoked whenever an event is received    repla...

How to make HTTP callout from LWC

Image
Hello Trailblazers, In this blog we are going discuss about HTTP callouts from Client-side controller in LWC. In Aura components we have Apex controller with AuraEnabled method which have code for HTTP callout in it. We call this Apex method on execution of some action and then send the response back to Aura component for processing. But with Lightning Web Components we can easily make callout from Javascript itself using fetch method. If you are not familiar with fetch method then please checkout this link . fetch method primarily takes 2 parameters as input which are endpoint and information about request which includes method type, header information , body of the request all in JSON format. fetch(endpont, { REQUEST_INFO}).then((response => response.json())).then((responseData) => {PROCESS_responseData_HERE}); Let’s start with the implementation. I am going to use Data Faker Heroku app for demonstration. In this example I will be focusing on getting data from third party so ...