# Custum App & App Functions

**URL:** <https://community.dynatrace.com/t/custum-app-app-functions/47968>\
**Category:** Developer Q&A Forum\
**Tags:** app-functions\
**Created:** [September 25, 2024, 8:54am UTC](https://community.dynatrace.com/t/custum-app-app-functions/47968 "2024-09-25T08:54:27Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![zaid-bashir](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/zaid-bashir/32/22651_2.png) [@zaid-bashir](https://community.dynatrace.com/u/zaid-bashir)\
**Post date:** [September 25, 2024, 8:54am UTC](https://community.dynatrace.com/t/custum-app-app-functions/47968/1 "2024-09-25T08:54:27Z")

</div>

I am developing a Custum App and app function in dynatrace to retrieve data from an API, and I would like to visualize this data using DataTable/DataTableV2. However, I am encountering some issues in the process.

I appreciate your help by providing a solution or giving me example code for the same.

---

<div class="post-metadata">

**Author:** ![StefanKern](https://avatars.discourse-cdn.com/v4/letter/s/a9adbd/32.png) [@StefanKern](https://community.dynatrace.com/u/StefanKern)\
**Post date:** [September 25, 2024, 12:03pm UTC](https://community.dynatrace.com/t/custum-app-app-functions/47968/2 "2024-09-25T12:03:04Z")

</div>

Hello&nbsp;[@zaid-bashir](https://community.dynatrace.com/user/79156),

We have a step-by-step tutorial for API data fetching, putting the data into a DataTable component and more here in the [Dynatrace Developer Portal](https://developer.dynatrace.com/quickstart/tutorial/).

For us to be able to help you with your exact problem, please share the related code and error messages.

All the best,

Stefan

---

<div class="post-metadata">

**Author:** ![zaid-bashir](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/zaid-bashir/32/22651_2.png) [@zaid-bashir](https://community.dynatrace.com/u/zaid-bashir)\
**Post date:** [September 26, 2024, 5:55am UTC](https://community.dynatrace.com/t/custum-app-app-functions/47968/3 "2024-09-26T05:55:28Z")

</div>

Hello&nbsp;[@StefanKern](https://community.dynatrace.com/user/70618)&nbsp;  
For Your Reference, Please Find The Code In An Image Below.

I Am Getting Some JSON Parsing Error and sometimes blank Page.  
Can You Help Me By Providing Code Snippet Related To This Issue. For Your Information I Am Accessing AuditLogs.

 ![Screenshot 2024-09-26 094835.png](https://global.discourse-cdn.com/dynatrace/original/2X/7/75fe2a7fba5e90e0150aad3caf20ef153e322d42.png)

---

<div class="post-metadata">

**Author:** ![imsingh](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/imsingh/32/7858_2.png) [@imsingh](https://community.dynatrace.com/u/imsingh)\
**Post date:** [September 26, 2024, 1:57pm UTC](https://community.dynatrace.com/t/custum-app-app-functions/47968/4 "2024-09-26T13:57:15Z")

</div>

It seems like you have syntax error in the code.

You should use the curly braces around `result.data` and `\</DataTable/\>` as following:

```markup
{result.data && (
  <DataTable data={auditLogsData} columns={convertToColumns(auditLogsData)}>
  </DataTable/>
)}

```

---

<div class="post-metadata">

**Author:** ![PennyScully](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/pennyscully/32/32029_2.png) [@PennyScully](https://community.dynatrace.com/u/PennyScully)\
**Post date:** [October 1, 2024, 6:48am UTC](https://community.dynatrace.com/t/custum-app-app-functions/47968/5 "2024-10-01T06:48:26Z")

</div>

Hi&nbsp;[@zaid-bashir](https://community.dynatrace.com/user/79156)

Let us know if the above solution works for you, if so, please ‘accept as solution’.

Thanks, PEnny

---

<div class="post-metadata">

**Author:** ![zaid-bashir](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/zaid-bashir/32/22651_2.png) [@zaid-bashir](https://community.dynatrace.com/u/zaid-bashir)\
**Post date:** [October 1, 2024, 10:18am UTC](https://community.dynatrace.com/t/custum-app-app-functions/47968/6 "2024-10-01T10:18:38Z")

</div>

Thanku For The Update.  
But I am still facing issue.

If Possible Then You Can Forward Your Working Version (Audit Logs)  
PFA AuditLogs JSX File and App Function File

 ![Screenshot 2024-10-01 141526.png](https://global.discourse-cdn.com/dynatrace/original/2X/a/a2c4f602ac0d21de6a1b94d61c2e2b491a42cc3d.png)

 ![Screenshot 2024-10-01 141401.png](https://global.discourse-cdn.com/dynatrace/original/2X/a/a77c57725e298a5d666d638ed501112f8a60575e.png)

---

<div class="post-metadata">

**Author:** ![Maheedhar\_T](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/maheedhar_t/32/155_2.png) [@Maheedhar\_T](https://community.dynatrace.com/u/Maheedhar_T)\
**Post date:** [October 3, 2024, 9:44am UTC](https://community.dynatrace.com/t/custum-app-app-functions/47968/7 "2024-10-03T09:44:06Z")

</div>

Hi&nbsp;[@zaid-bashir](https://community.dynatrace.com/user/79156)&nbsp;,  
Not Sure if you found a solution for this yet but can you just paste your error here?

Sometimes all you have to do is do JSON.stringify(data) in the code and then in the DataTable use JSON.parse(data). This ensures that all the JSON data is properly organised with proper formatting.

In your case all you have to do is change these two steps.  
const auditLogsData = JSON.stringify(result);

Then in DataTable you change data={JSON.parse(auditLogsData)}

---

<div class="post-metadata">

**Author:** ![zaid-bashir](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/zaid-bashir/32/22651_2.png) [@zaid-bashir](https://community.dynatrace.com/u/zaid-bashir)\
**Post date:** [October 3, 2024, 11:55am UTC](https://community.dynatrace.com/t/custum-app-app-functions/47968/8 "2024-10-03T11:55:26Z")

</div>

Thanks&nbsp;[@Maheedhar\_T](https://community.dynatrace.com/user/76275)
