1

Here is a simple Screen Flow that lets user quickly create an Opportunity and a Quote with one click. Customer wants to keep just a single screen and prefers Flow over LWC (for maintenance concerns). The task is: when user selects Account (1.) then dynamically fill in Opportunity Currency (2.) field with the Account Currency.

Current State Of Salesforce Flow

I used Data Fetcher to obtain Account's Currency - and this part works fine when an Account Id is hard-coded. But I can't pass selected Account Id to the formula. I get an error "The "basicAccountId" resource can't be used as a merge field."

Trying to use Lookup component as a merge field

Error when using Lookup component as a merge field

What else I tried - Manually assign Output Value to a Variable - it doesn't work dynamically

Trying to assign Id to a variable

Variable is not dynamically updated on Account selection

Any idea on how to bypass this Salesforce limitation?

EDIT: Extra screenshots of how I wanted to use the merge field with Data Fetcher, no success: trying to use {!basicAccountId} in SOQL query trying to use {!basicAccountId.recordId} in SOQL query trying to use {!basicAccountId.Id} in SOQL query

2 Answers 2

2

Summary:

I ran into an issue where my screen flow wouldn't recognize {!basicAccountId.recordId} as a valid merge field, even though it should have worked based on Salesforce documentation.

What I Tried:

✔ Used resource selection in Flow Builder instead of typing manually.

✔ Verified that my API version was updated (was originally v60.0).

✔ Double-checked the input component name to ensure accuracy.

The Real Issue: The problem was that it was an old Flow - and the old Lookup Component. It had an old API version nested inside, which caused the issue, despite I changed the Flow version to 63.0.

The Solution: 🔄 Replace the Lookup Component:

  1. Delete the old Lookup Component from the screen.
  2. Add a new one in its place.

That’s it! No need to rebuild the entire flow—just swap out the Lookup Component, and everything should work fine.

#justSalesforceThings 😅

1

Reactivity based on standard components that support it requires you to directly use the output from that component as the input to another component. You cannot use it to update a variable that you subsequently use as input to another component (since this isn't supported for reactivity scenarios).

If I have a single selection Lookup component with API name "AccountLookup" on my screen, I can use the selection as an input to another LWC by using:

{!AccountLookup.recordId} 

If it's multi-select, I need to use:

{!AccountLookup.recordIds} 

I added these references using the resource selector in the flow builder. That way I know I have the correct value.

4
  • Hey Phil, thanks for your response! Yeah, I can’t use the output to update a variable either. That was just another attempt after Salesforce blocked me from using the output directly—despite what the docs say. I also tried {!basicAccountId.recordId}, but it throws an error: "{!basicAccountId.recordId}" isn't a valid merge field. Think I should open a case with Salesforce Support? Commented Mar 28 at 14:16
  • When inserting the reference, did you use the resource selection feature in the flow builder, or type the reference by hand? I created a test screen flow and had no issues with using such a {!InputAPIName.recordIds} reference, which I did add using resource selection. I'm wondering if you have the wrong name for the input component? Commented Mar 28 at 15:23
  • THANK YOU, Phil! Seriously, really appreciate your help! 🙌 I did use the resource selection, but it didn’t work—probably something off with the existing flow. Created a new screen flow, and boom, it works just like you said! The old flow was on API v60.0, which I updated at the start, but that wasn’t enough. Guess I just had to rebuild instead of editing. AWWGGGHHH #justSalesforceThings 😩😂 Commented Mar 30 at 9:05
  • -That seems really strange and something it might be good to raise a Salesforce Support case with, if you still have the original flow meta XML file.- Ah just read your self-answer. Good spot. Commented Mar 31 at 7:37

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.