# Payhere Customers -\> Payments -\> Find matching payment to row id

**URL:** <https://community.glideapps.com/t/payhere-customers-payments-find-matching-payment-to-row-id/66543>\
**Category:** Ask for Help\
**Created:** [September 26, 2023, 6:46pm UTC](https://community.glideapps.com/t/payhere-customers-payments-find-matching-payment-to-row-id/66543 "2023-09-26T18:46:44Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Brandon](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/brandon/32/58098_2.png) [@Brandon](https://community.glideapps.com/u/Brandon)\
**Post date:** [September 26, 2023, 6:46pm UTC](https://community.glideapps.com/t/payhere-customers-payments-find-matching-payment-to-row-id/66543/1 "2023-09-26T18:46:44Z")

</div>

The issue:  
Hello this post is referencing this video here [https://www.youtube.com/watch?v=pGjMm-RFXZY](https://www.youtube.com/watch?v=pGjMm-RFXZY)  
The difference of my approach is that I am trying to find payments with matching hidden fields instead of subscriptions.

I’ve made it to this part where all there is left is to fetch to correct data from JSON customer Data.  
As it stands it fetches all payments, where I need it to fetch the one that matches the rowid.

Resolution I’m looking for:

1. Take the JSON output below and find the bid\_id (this is the rowid)
2. Then sort the bid\_id to the current table’s rowid so that the json output matches it’s rowid/bidid

Proposed solution: perhaps there is a java formula that could be used here to find the match, no luck with my testing.

JSON Output:  
 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/9/8/988f7dfee74b7838e8601dbd3117c84dfe3a15e5.png)  
[  
{  
“id”: 246792,  
“reference”: null,  
“amount\_in\_cents”: 105,  
“stripe\_charge\_id”: “ch\_3NuSWmL0nr8YXLGN1m6T1f7G”,  
“company\_id”: 6761,  
“created\_at”: “2023-09-26T04:05:44.103Z”,  
“updated\_at”: “2023-09-26T04:05:44.103Z”,  
“card\_brand”: “discover”,  
“card\_country”: null,  
“card\_last4”: “3595”,  
“secure\_token”: “QJiiKfvV11KHplMXEAxqhA”,  
“application\_fee\_in\_cents”: 2,  
“metadata”: {  
“gateway\_fee\_in\_cents”: 33  
},  
“subscription\_id”: null,  
“customer\_id”: 292199,  
“user\_present”: true,  
“products\_purchased”: ,  
“ip\_address”: “2603:6010:ba00:b615:c534:516b:a3d7:6c7f”,  
“location”: {},  
“status”: “success”,  
“refunded\_at”: null,  
“refund\_amount\_in\_cents”: 0,  
“currency”: “usd”,  
“stripe\_card\_token”: null,  
“last\_error”: null,  
“object\_type”: “Plan”,  
“object\_id”: 23514,  
“usd\_amount\_in\_cents”: 105,  
“stripe\_payment\_method”: null,  
“purchased\_qty”: 1,  
“provider”: “stripe”,  
“custom\_fields”: {  
“bid\_id”: “XqyZmAEhR9mGjFrjkzuafg”,  
“user\_id”: “392f639a-eb36-4ceb-a516-900a21eca986”  
},  
“gocardless\_payment\_id”: null,  
“failed\_attempts”: 0,  
“vat\_included”: false,  
“vat\_rate”: “0.0”,  
“vat\_amount\_in\_cents”: 0,  
“ex\_vat\_amount\_in\_cents”: 105,  
“country\_code”: “US”,  
“invoice\_id”: null,  
“coupon\_code”: null,  
“discount\_percent”: “0.0”,  
“temporary”: false  
}  
]

```auto

```

---

<div class="post-metadata">

**Author:** ![Brandon](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/brandon/32/58098_2.png) [@Brandon](https://community.glideapps.com/u/Brandon)\
**Post date:** [September 26, 2023, 7:21pm UTC](https://community.glideapps.com/t/payhere-customers-payments-find-matching-payment-to-row-id/66543/2 "2023-09-26T19:21:59Z")

</div>

Trying to use the distinct call to filter it.

> **[Array Functions · JSONata](https://docs.jsonata.org/array-functions)**
>
> \## \`$count()\`

$distinct(custom\_fields.bid\_id) =\> [“X”]  
 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/e/b/eb040169f310bbacff2967464616da3e54f0357d.png)

Not working so far…

---

<div class="post-metadata">

**Author:** ![Robert\_Petitto](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/robert_petitto/32/25193_2.png) [@Robert\_Petitto](https://community.glideapps.com/u/Robert_Petitto)\
**Post date:** [September 26, 2023, 8:32pm UTC](https://community.glideapps.com/t/payhere-customers-payments-find-matching-payment-to-row-id/66543/3 "2023-09-26T20:32:56Z")

</div>

Maybe a `filter()` function?

---

<div class="post-metadata">

**Author:** ![Brandon](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/brandon/32/58098_2.png) [@Brandon](https://community.glideapps.com/u/Brandon)\
**Post date:** [September 26, 2023, 8:40pm UTC](https://community.glideapps.com/t/payhere-customers-payments-find-matching-payment-to-row-id/66543/4 "2023-09-26T20:40:32Z")

</div>

Thank you for the response!

I found this method as well which I found to work.  
1.  
 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/d/8/d8804093ac0d4febde72d342b41a3456192768ac.png)  
2.  
 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/c/6/c64f4a7d905b1dca06fb07410d90bda81ef11557.png)

Searches for successful payments and only checks true if the row\_id matches.

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/system/32/53398_2.png) [@system](https://community.glideapps.com/u/system)\
**Post date:** [October 3, 2023, 8:41pm UTC](https://community.glideapps.com/t/payhere-customers-payments-find-matching-payment-to-row-id/66543/5 "2023-10-03T20:41:15Z")

</div>

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.
