0

I was trying to develop LWC that retrieves Service Resource Id and pass it to Generate Appointment Invitation flow, which is called it from <lightning-flow> tag.

Salesforce help: Generate an Appointment Invitation URL

However, I passed two input variables the following, however got the error below.

enter image description here

 flowInputVariables = [ { name: 'recordId', type: 'String', value: this.recordId, }, { name: 'InvitationURLPrefix', type: 'String', value: this.InvitationURLPrefix, }, ]; 

recordId is successfully passed from Parent LWC.

<template> <!-- Invoke a Screen flow in LWC --> <span> test2 {recordId} </span> <lightning-flow flow-api-name={flowApiName} flow-input-variables={flowInputVariables} onstatuschange={handleFlowStatusChange}> </lightning-flow> </template> 

I am not sure why this is not working, but I found the post similar to this: Lightning Web Component isn't available for Salesforce Scheduler Flow

Passing recordId value to flow debugging just works. So I suspect caling Scheduler Screen Flow is not worked from LWC?

4
  • Hi @mkzyk, are you retrieving the recordId from within your LWC or is that being passed into that component as an attribute? I suspect the issue may actually be required to when that recordId is available compared to when the flow is being passed the attributes. Commented Dec 19, 2022 at 20:10
  • Hi @CallumMacErlich, thanks for your comment. recordId variable is passed from Parent Component as @api variable. Commented Dec 20, 2022 at 0:59
  • Would you be able to try hiding the <lightning-flow> until the recordId has definitely been populated? Something like ``` <template if:true={recordIdPopulated}> ``` in your HTML file, and a getter method in your JS file to return if that is ready? That will just confirm if it is what I suspect. Commented Dec 20, 2022 at 1:16
  • @CallumMacErlich Yes, I did use <template if:true> to call a flow, but finally I figured this out. I passed recordId from Parent Component as <c-child-component record-id={recordId}></c-child-component>, in that case the recordId variable must be @api (public) on child component, I don't know this is whether feature specification, public variable can not be passed into a flow as flow-input-variables, I changed calling a flow from parent and passed recordId directly, it has been worked! (but when I changed recordId variable as @api, it does not work.) Commented Dec 20, 2022 at 1:48

0

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.