You need to sign in to do that
Don't have an account?

display json array values
I have a json as follows.
[{"claimId":"M00234835","dateOfServiceBegin":"2018-12-31","legalOwnerName":"Joseph, Alice A","totalBilled":1000,"summary":"summary1","description":"descp1","dateTime":"2019-04-22T05:51:00.000Z","priority":"Low"},
{"claimId":"M00234834","dateOfServiceBegin":"2019-01-01","legalOwnerName":"Health 1st PC","totalBilled":1000,"summary":"","dateTime":"","priority":"Low"}]
I have a lightning component and in the markup I want to display the individual values of the above json.
so I am doing l like this.
<aura:attribute name="claimReworkRecords" type="Object" access="global" description="Claims Rework Data"/>
Now I am getting the entire JSON data into the above attribute I specified.
for(var i=0;i<claimsData.length;i++)
{
claimReworkRecords.push({
"claimId": claimsData[i].claimId,
"dateOfServiceBegin":claimsData[i].dateOfServiceBegin,
"legalOwnerName":claimsData[i].legalOwnerName,
"totalBilled":claimsData[i].totalBilled,
"dateTime":dateTime[i],
"priority":priority[i],
"summary":summary[i],
"description":description[i],
})
}
Now I want to display the individual values so in markup I am doing like this
<aura:iteration items="{!v.claimReworkRecords}" var="claim" indexVar="indx">
{!claim.claimId}
{!claim.dateOfServiceBegin}
</aura:iteration>
But its not displaying the individual values. Pleas let me know with correct code how I can achive this.
thanks
meghna
[{"claimId":"M00234835","dateOfServiceBegin":"2018-12-31","legalOwnerName":"Joseph, Alice A","totalBilled":1000,"summary":"summary1","description":"descp1","dateTime":"2019-04-22T05:51:00.000Z","priority":"Low"},
{"claimId":"M00234834","dateOfServiceBegin":"2019-01-01","legalOwnerName":"Health 1st PC","totalBilled":1000,"summary":"","dateTime":"","priority":"Low"}]
I have a lightning component and in the markup I want to display the individual values of the above json.
so I am doing l like this.
<aura:attribute name="claimReworkRecords" type="Object" access="global" description="Claims Rework Data"/>
Now I am getting the entire JSON data into the above attribute I specified.
for(var i=0;i<claimsData.length;i++)
{
claimReworkRecords.push({
"claimId": claimsData[i].claimId,
"dateOfServiceBegin":claimsData[i].dateOfServiceBegin,
"legalOwnerName":claimsData[i].legalOwnerName,
"totalBilled":claimsData[i].totalBilled,
"dateTime":dateTime[i],
"priority":priority[i],
"summary":summary[i],
"description":description[i],
})
}
Now I want to display the individual values so in markup I am doing like this
<aura:iteration items="{!v.claimReworkRecords}" var="claim" indexVar="indx">
{!claim.claimId}
{!claim.dateOfServiceBegin}
</aura:iteration>
But its not displaying the individual values. Pleas let me know with correct code how I can achive this.
thanks
meghna
Component: Controller: Output:
I hope you find the above solution helpful. If it does mark as best answer to help others too.
Thanks,
Ramesh D
All Answers
Component: Controller: Output:
I hope you find the above solution helpful. If it does mark as best answer to help others too.
Thanks,
Ramesh D
Thanks that's working