1

I have embedded a child flexcard as custom LWC inside another flexcard due to different datasource. I want to pass the accountId as an input parameter to the custom LWC but can't seem to determine how to do so.

It's working fine, If I pass a hardcoded value in the Child Flexcard but when I pass {recordId} as an attribute value for custom lwc it's not working as expected.

3
  • I'm not knowledgable regarding Omnistudio, but from a LWC developer perspective, I'd recommend to add the LWC configuration (*.js-meta.xml) and the relevant Javascript code to the question. Feb 6 at 8:10
  • Thanks @FelixvanHove It's a Flexcard which is embedded as a custom lwc inside another flexcard.
    – hash
    Feb 7 at 1:30
  • not able to add a screengrabs here, will try again
    – hash
    Feb 7 at 1:32

1 Answer 1

0

I am assuming the {recordId} you want to pass to the custom LWC is the accountId? By default, the recordId is always available as a property on App pages and record pages. See Salesforce documentation here. You can confirm this by going to your activated Flexcard's Publish Options and on the Editor tab, you will see it listed:

enter image description here

enter image description here

As you are already using the merge field {recordId} to pass the recordId to the custom LWC, it might be good to add some debugging text just to see that the recordId is in fact included in the {recordId} merge field.

You can do this by adding a Rich Text field to your Flexcard and adding something in the line of RecordId: {recordId} in its Text Properties.

Activate your flexcard, embed it where it needs to be embedded (assuming again it is the Account record page) and see if the merge field updates with the corresponding recordId for different Account records. I built a minimal working example Flexcard that shows the recordId of the record where it is embedded (you can find the exported Flexcard JSON here):

enter image description here

enter image description here

enter image description here

Once you have determined that the recordId is passed correctly to the merge field, then you can try and pass it to the custom LWC.

If it still doesn't work, then at least you know the issue is not with the merge field, but rather somewhere else.

Good luck!

3
  • You can only see the Editor tab if you are running the managed package runtime setting from OmniStudio settings in Setup. It seems like the Managed Package runtime is intended to be off but they have it visible for those migrating. If anyone finds this in the future they might not even see the editor view at all and this is why. I have to manually edit the code to get to the data shown in your screenshot.
    – ReidB
    Mar 9 at 22:38
  • @ReidB I do not recommend editing the code in the editor. I have done so before and must have done something wrong as it broke my whole Flexcard. I just use it for debugging and confirmation that the recordId is exposed Mar 10 at 5:12
  • Yeah, I was merely saying that you can't even see that box to double check if your settings are what seems to be suggested for Standard OmniStudio deployments.
    – ReidB
    Mar 10 at 17:59

You must log in to answer this question.

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