0

I am displaying a list of tasks related to a record in LWC. In the same LWC I have a New button which will call a FLOW and new task will be created via FLOW. I am looking for a way to show the updated list with the new record in my LWC. I am not finding a triggering point to refresh the list.

Below is the screen where a record has 0 open and 0 closed tasks and a button to create a new task.

enter image description here

When I click the New Task , a flow gets triggered and new task will be created in the backend. How to show the updated list in the UI.

I am getting the existing list on page load, but to get the newly added values I have to manually refresh as i do not have a triggering point. Any ideas on how to refresh the list once a record is created in Flow. I used @wire to display the initial records but to use refreshApex(theList) I do not have any method to refresh the list.

1 Answer 1

1

Found a triggering point finally. While calling the flow there will be an attribute 'onstatuschange' for which you can write a custom method and handle your refreshApex() or imperative method calls, which will get the latest data from backend.

<lightning-flow
             flow-api-name={flowApiName}
             flow-input-variables={flowInputVariables}
             onstatuschange={handleFlowStatusChange}
         >
</lightning-flow>

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .