Posts

Showing posts with the label datatable

Salesforce Fact #909 | Editable date column in lightning datatable

Image
In lightning datatable, if we have a date format editable column we can use the type as 'date' or 'date-local'. If we use 'date' the editable window shows the time part also, using 'date-local' shows only date part. Reference:  https://developer.salesforce.com/docs/component-library/bundle/lightning-datatable/documentation Attached are the screenshots.

Salesforce Fact #844 | Screen flow datatable and lightning record picker reactivity combo

Image
We have the new record picker component in LWC and that works perfectly as reactive in screen flow. Suppose, we have a datatable in screen flow which is displaying certain account records and once we select a row, we want to make use of the record picker to show only related contacts of the selected account for selection. In LWC, we make use of the getRecord() LDS function to set the filter value reactively based on each time the accountId is passed from screen flow to LWC. Attached are the screenshots.

Salesforce Fact #832 | Screen flow: using Transform element result in datatable

Image
In Screen flow, we can now use the Transform(Beta) element. We can use the result of the transform element in the standard screen flow datatable. In this example, we have fetched few account records and showing those records in the datatable after doing some manipulation. Couple of things to observe, 1) While trying to map in a sobject collection variable, the Id field is not available. 2) We have used BLANKVALUE() function on the account number, to show 'NOT AVAILABLE' when the account number is blank. 3) The TEXT() function is automatically added when mapping the picklist field values. It happened with the Industry and Rating fields. Attached are the screenshots.

Salesforce Fact #823 | Count restriction with repeater and datatable combo in screen flow

Image
With the new Repeater(Beta) component in screen flow, we can repeat the same input structure multiple times as we want but there is no simple way of putting a validation on the count i.e. till how many instances the repeat should happen. We can use a datatable to show the data entered in the repeater instances and at the same time make use of the minimum selection and maximum selection options to restrict the number of user selections. In this example, we are using the Repeater component to accept input for the account record fields and in the data table the entered data is shown and the user is allowed to select maximum 3 records, thus imposing the restriction on the count. Attached are the screenshots.

Salesforce Fact #781 | Showing formula field value in screen flow datatable

Image
We can show formula field values as well in screen flow datatable. Suppose we have a field in Lead which shows the lead rating in the form of stars and which is basically a formula(text) field using the IMAGE() function. The field value can be shown in datatable. Attached are the screenshots.

Salesforce Fact #780 | lightning map of selected record in screen flow datatable

Image
We use mapMarkers in LWC to show the map for an address. We can render the address map for the address of a selected record in screen flow datatable using a LWC. In this example, we are rendering the map for the shipping address of the selected account record considering the ShippingLatitude and ShippingLongitude values. Attached are the screenshots.

Salesforce Fact #778 | Related record count of selected account of screen flow datatable

Image
Suppose we want to show the related contact and opportunity count of the selected account from the screen flow datatable. With the latest update of screen flow reactivity, this can be accomplished. We can create a LWC component which would use graphql wire adapter to get the count. Attached are the screenshots.

Salesforce Fact #773 | Hide contact phone and email in screen flow datatable

Image
Suppose there is a scenario where we need to show the contact email and phone in screen flow datatable only if a particular custom permission is assigned to the user. Otherwise, it would be hidden to the user. We can implement the same using a bit of formula logic. Attached are the screenshots.

Salesforce Fact #772 | Reactive screen flow datatable

Image
Screen flow reactivity is available with DataTable as well. Suppose we have a scenario where we have a datatable in screen flow and the selected row needs to be auto-populated in a lookup input. We can get this using reactivity on the screen flow. Note: This will only work for single select datatable because for multiple selection, it is a collection of records in screen flow but in lookup it expects collection of ids. so, it doesn't work. Attached are the screenshots.

Salesforce Fact #770 | Preselect rows in screen flow datatable

Image
In screen flow datatable, we have a Default Selection option using which we can make few rows pre-selected. In this example, we are preselecting the account rows where Rating = 'Cold'. Attached are the screenshots.