+ Start a Discussion
Lukesh KarmoreLukesh Karmore 

how to fetch item.itemId from JSON In Visualforce

Hii Forum ,I have json as follow

[{"recordType":"cashsale","id":"200724","values":{"tranid":"Memorized","entity":[{"value":"3155","text":"100032 EJ's Pizzeria"}],"trandate":"03/04/2020","postingperiod":[{"value":"90","text":"Mar 2020"}],"amount":"140.00","item.itemid":"300-52-3100-S","item.displayname":"Revention Software Maintenance Monthly Subscription","item.salesdescription":"Revention Software Maintenance Monthly","type":[{"value":"CashSale","text":"Cash Sale"}]}}
VF code :
[15:08] Rahul Manjhi
 <apex:column headerValue="tranid" value="{!wrap.values.tranid}​​​​​​​"/>     <apex:column headerValue="item" value="{​​​​​​​!wrap.values.item.itemid}​​​​​​​"/> 
<apex:column headerValue="item" value="{​​​​​​​!wrap.item.itemid}​​​​​​​"/>          <apex:column headerValue="trandate" value="{​​​​​​​!wrap.values.trandate}​​​​​​​"/>                 
<apex:column headerValue="entity" value="{​​​​​​​!wrap.values.entity}​​​​​​​"/>                values.item.itemid gives null value how to get it any one have idea.
Thank you
ShivankurShivankur (Salesforce Developers) 
Hi Lukesh,

You could try to display the whole content in the Visualforce page first using the approach suggested over below thread:

https://developer.salesforce.com/forums/?id=9062I000000g7K2QAI

Once you have data printed correctly, you can narrow down the page to show only specific attribute such as item.itemid.

Hope above information helps. Please mark as Best Answer so that it can help others in future.

Thanks.