How to load a JSON File using script in ERPNext?

Actually, I have a situation where I have 8 columns in a child table and all of them are Grid View enabled, but I want to see few of them based on a selection. I tried different ways to do it, but didn’t get success therefore, I want to check it via JSON file, like I noticed there is JSON file named sales_order_item.JSON which tells which field is hidden and which fields has list_view=1.

So, just wanted to try by creating a JSON file in my app and calling that file based upon a condition.

Regards
Ruchin Sharma

Or you could use an HTML field, and write custom script to show columns dynamically, assuming you only want to show the data and not modify it.

@netchampfaris
I appreciate, if you may elaborate how to do this?

Edit: No, I want to show the data and allow the user to modify the same as well.

Regards
Ruchin Sharma

See Sales Order doctype for example. It has an HTML field which shows the tax breakup in a table.

1 Like

@netchampfaris
Yes, I have seen that but, that doesn’t solve my purpose.

Regards
Ruchin Sharma

I also don’t know how to load a JSON file using script in ERPNext. Please help me with it

You will have to read your json file in python and then parse it using json.loads