PASS MULTIPLE PARAMETER TO LWC IN PUBLIC COMMUNITY PAGE WITH SIMPLE EXAMPLE
How to Pass Multiple Parameter to LWC in Public Community Page?
Create a LWC component TestCommunity.
In TestCommunity.js-meta.xml, add the <target> and <property> tags as the example below and save the file.
<?xml version="1.0" encoding="UTF-8"?> <LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata"> <apiVersion>50.0</apiVersion> <isExposed>true</isExposed> <targets> <target>lightningCommunity__Page</target> <target>lightningCommunity__Default</target> <target>lightning__HomePage</target> </targets> <targetConfigs> <targetConfig targets="lightningCommunity__Default"> <property name="recordId" type="String" label="Record ID" description="The value should be {!recordId}." /> <property name="taskId" type="String" label="Task ID" description="The value should be {!taskId}." /> </targetConfig> </targetConfigs> </LightningComponentBundle>
In TestCommunity.js file using @api annotation for recordId and taskId propoerty in js.
import { LightningElement, api} from 'lwc'; export default class TestCommunity extends LightningElement { @api recordId; @api taskId; }
In html page print the values of recordId and taskId.
<template> <p>{recordId}</p> <p>{taskId}</p> </template>
Create new Community page and add TestCommunity LWC to the page and click publish.
https://dineshgdk.force.com/TestCommunity/s/?recordId=00O3A000001xFw7AAF&taskId=00F6w000002t5BAEAZ
Pass the values in the parameter as above using ampersand ‘&’.
provoke
June 9, 2022Woaһ! I’m really lօving the template/theme of this weЬsite.
It’s ѕimple, yet effective. A lߋt of times it’s hard to get that “perfect balance” between user friendliness and appearance.
I must say you’vе done a awesome job with this. In addition, the blοg loads νerу fast for me on Chrome.
Outstanding Blog!
admin
June 9, 2022Thankyou for your valuable feedback.
foible
June 15, 2022Ƭhis is a topic that is close to mу heart… Cheerѕ! Where are your contact details
though?
material
June 19, 2022Hello! Someone in my Facebook group shared this websіte wіth us so I
came to givе it a loоk. I’m definitely enjoying the information.
I’m bookmaгking and will be tweeting this to my fⲟllowers!
Terrific blog and superb design and style.
admin
June 23, 2022Thankyou for your valuable feedback.
graliontorile
August 31, 2022Yay google is my world beater helped me to find this great website ! .
erosible
February 6, 2023Nіce post. I learn something new and challenging on sites I
stumbleupon every ɗay. It’s always exciting to read ⅽontеnt from other writers and use
something from their sites.
zoritoler imol
June 6, 2023As a Newbie, I am constantly searching online for articles that can be of assistance to me. Thank you
moroccan
June 18, 2023Thаnks for any other informative website. The pⅼace else mɑy
І am getting that kind of information wгitten in suсh
a perfect way? I’ve а chalⅼengе tһat I’m simply now oрerаting οn, and I
have been on the look out for such info.