Dynamic Questions in Lightning Flow

It’s now possible to create dynamic questions, where child questions appear and disappear based on the selection made in the parent question.

Here’s a video that demonstrates just a few of the useful things you can do with dynamic questions.

The implementation of dynamic questions takes advantage of Lightning Flow’s new ability, as of Spring ’18, to insert lightning components into flow screens. Using this, we’ve built a lightning component that produces dynamic questions upon request, and packaged it so that you can use it without touching code.

For more information, see https://github.com/alexed1/LightningFlowComponents/tree/master/flow_screen_components/dynamicQuestionFSC

The “Update Screen” Flow Action Component

Flow Action Components, also known as Local Actions, are a new Flow enhancement in pilot as part of the Spring ’18 release. They’re discussed more here.

This Component works in Lightning Experience.

We created the Update Screen component to address a small but annoying problem some of our customers were having as they integrate flows into their work. They would run a flow from a Quick Action button, and the flow would change the value of a field that was already on the screen. The screen wouldn’t know that the field had changed because the change is done in the cloud and the data on screen has already been downloaded.

Tack this Update Screen action on the end of that flow, though, and the screen will instantly update, and do so without a full page refresh.

We place the UpdateScreen action after we update the value

The component, like other Flow Action Components and Flow Screen Components is available for installation from our component repository. The installation process may be intimidating to non-developers but you do not actually need to know anything about development to install this component. If you can copy and paste and follow directions, you can install UpdateScreen into your org. And once it’s installed, it will always thereafter be available in the Cloud Flow Designer palette to be added to flows.


How Does It Work?

For those who want to look beneath the hood, UpdateScreen is actually an extremely simple component. It makes use of the Force:RecordData component produced by the Salesforce Platform team:


Here’s where the magic happens:


When the flow engine reaches a Flow Action Component it calls that component’s invoke method. In this case, UpdateScreen then calls upon the force:recordData component to reload the record, which causes the smart Lightning caching logic to refresh the correct record.

Working with Related Lists

Each Update Screen action can currently only trigger refresh for a single object. So a single Update Screen is not able, for example ,to refresh a parent object and several related actions at the same time. But there’s nothing preventing you would putting an Update Screen in a loop that iterates over Related List records, or stringing multiple Update Screens together.

Here’s an example:

This Contact has several related Credit Accounts:


The flow in the upper right closes Accounts, changing their status. You want the ones that are closed to be refreshed in the Related List in the lower left.

To accomplish this, the Flow loops over the changed Credit Accounts:


Each time, the UpdateScreen is passed the current element from the collection of changed items:


If necessary, a separate Update Screen can be used to update the parent object.

Using Update Screen as a Screen Component

You don’t have to be in the Local Actions pilot to try this out, though. You can also create a Flow Screen Component that does this, and insert it into one of your flow screens. That could make sense if your flow had a screen that you wanted the user to go to after the data was changed on the server. To learn more about creating Flow Screen Components, see the release notes.

Using Salesforce SFDX With Docker — Authenticating and Opening your Scratch Org

SFDX revolutionizes the development process for Salesforce, but a few steps are necessary if you want to use it with Docker. I keep my dev environment in a Docker container, and I haven’t figured out how to get that container to open URL’s on my machine, so I need to use headless authentication. Fortunately, that’s working pretty well, but the docs aren’t quite fully fleshed out. Here are a few guidelines.

  1. Follow the instructions on https://developer.salesforce.com/docs/atlas.en-us.210.0.sfdx_dev.meta/sfdx_dev/sfdx_dev_auth_jwt_flow.htm to get authentication working between your docker command line and your dev hub-enabled Salesforce org. At the end of this, you should be able to run the sfdx force:auth:jwt:grant command and get a successful authentication. Here’s an example of one of my auth commands:

sfdx force:auth:jwt:grant -i 3MVG9SemV5D80oBfzS3G0K4.t5Sifyb7VXmlLeO1OmKYa632CSnEvgOwIXpzbIBqCKGMAFKejKqUm1Cq0dUP2 -u alex@df.flow.dev -f ~/dev/certificates/flowbolt/server.key — setdefaultdevhubusername

Successfully authorized alex@df.flow.dev with org ID 00DB0000000LRppMAG

2. Next you want to be able to create and open up the scratch org so you can use the results of any source pushes you do, and also make changes using Salesforce UI that you can then source pull down into your local project. This is a little opaque currently. Creation is straightforward, now that you’re authenticated. But when you try to open, following the instructions at the bottom of https://developer.salesforce.com/docs/atlas.en-us.210.0.sfdx_dev.meta/sfdx_dev/sfdx_dev_scratch_orgs_create.htm, you may just get a hang. There is probably a solution for this involving virtual X terminals but I haven’t figured it out yet, and it’s useful in any case to know the workaround, which is to use the “-r” flag to get the URL:

sfdx force:org:open -r

Access org 00D9A000000D1UhUAK as user test-j7ldiskpjtlh@example.com with the following URL: https://saas-computing-55-dev-ed.cs46.my.salesforce.com/secur/frontdoor.jsp?sid=00D9A000000D1Uh!AQ8AQHH98dOHdq2ylIaNFZEh6WSp9ogFKGDxAKwcnwPmAGZT8.xoH7qu7DuB1c.hSBNAHnG_nqBqxFWapn8xf7maoQUbx5KI

This returns a link that you can pop into your browser to immediately load up your scratch org. You’ll see any objects that you’ve source pushed.

A nice post

Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem.

Nulla consequat massa quis enim. Donec pede justo, fringilla vel, aliquet nec, vulputate eget, arcu. In enim justo, rhoncus ut, imperdiet a, venenatis vitae, justo. Nullam dictum felis eu pede mollis pretium. Integer tincidunt. Cras dapibus. Vivamus elementum semper nisi. Aenean vulputate eleifend tellus. Aenean leo ligula, porttitor eu, consequat vitae, eleifend ac, enim.

Read more

Entry without preview image

Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem.

  1. Nulla consequat massa quis enim.
  2. Donec pede justo, fringilla vel, aliquet nec, vulputate eget, arcu.
  3. In enim justo, rhoncus ut, imperdiet a, venenatis vitae, justo.

Nullam dictum felis eu pede mollis pretium. Integer tincidunt. Cras dapibus. Vivamus elementum semper nisi. Aenean vulputate eleifend tellus. Aenean leo ligula, porttitor eu, consequat vitae, eleifend ac, enim. Aliquam lorem ante, dapibus in, viverra quis, feugiat a, tellus.

Read more

A nice entry

Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem.

Nulla consequat massa quis enim. Donec pede justo, fringilla vel, aliquet nec, vulputate eget, arcu. In enim justo, rhoncus ut, imperdiet a, venenatis vitae, justo. Nullam dictum felis eu pede mollis pretium. Integer tincidunt. Cras dapibus. Vivamus elementum semper nisi. Aenean vulputate eleifend tellus. Aenean leo ligula, porttitor eu, consequat vitae, eleifend ac, enim.

Read more

Entry with Audio

Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem.

Nulla consequat massa quis enim. Donec pede justo, fringilla vel, aliquet nec, vulputate eget, arcu. In enim justo, rhoncus ut, imperdiet a, venenatis vitae, justo. Nullam dictum felis eu pede mollis pretium. Integer.

  • Donec posuere vulputate arcu.
  • Phasellus accumsan cursus velit.
  • Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae;
  • Sed aliquam, nisi quis porttitor congue

Read more

Entry with Post Format “Video”

Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem. Nulla consequat massa quis enim. Donec pede justo, fringilla vel, aliquet nec, vulputate eget, arcu. In enim justo, rhoncus ut, imperdiet a, venenatis vitae, justo.

Nullam dictum felis eu pede mollis pretium. Integer tincidunt. Cras dapibus. Vivamus elementum semper nisi. Aenean vulputate eleifend tellus. Aenean leo ligula, porttitor eu, consequat vitae, eleifend ac, enim. Aliquam lorem ante, dapibus in, viverra quis, feugiat a, tellus.

 

Read more

A small gallery

Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem.

  • Nulla consequat massa quis enim.
  • Donec pede justo, fringilla vel, aliquet nec, vulputate eget, arcu.
  • In enim justo, rhoncus ut, imperdiet a, venenatis vitae, justo.
  • Nullam dictum felis eu pede mollis pretium. Integer tincidunt. Cras dapibus. Vivamus elementum semper nisi.

Aenean vulputate eleifend tellus. Aenean leo ligula, porttitor eu, consequat vitae, eleifend ac, enim.

Read more

This is a post with post type “Link”

Entries with this post type link to a different page with their headline. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor.