# How to get data from BDM when we have integer and string, both kinds of  data types

**URL:** <https://community.ofelia.com/t/how-to-get-data-from-bdm-when-we-have-integer-and-string-both-kinds-of-data-types/10863>\
**Category:** Q&A\
**Created:** [27 July 2021 19:19 UTC](https://community.ofelia.com/t/how-to-get-data-from-bdm-when-we-have-integer-and-string-both-kinds-of-data-types/10863 "2021-07-27T19:19:37Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![azade](https://avatars.discourse-cdn.com/v4/letter/a/8baadc/32.png) [@azade](https://community.ofelia.com/u/azade)\
**Post date:** [27 July 2021 19:19 UTC](https://community.ofelia.com/t/how-to-get-data-from-bdm-when-we-have-integer-and-string-both-kinds-of-data-types/10863/1 "2021-07-27T19:19:37Z")

</div>

I have tried this querry  
SELECT e&nbsp;  
FROM Employee e&nbsp;  
WHERE e.positionemp LIKE :positionemp  
AND e.department LIKE :department  
AND e.location LIKE :location  
AND e.segement LIKE :segement  
AND e.nationality LIKE :nationality  
AND e.employeelastname LIKE :employeelastname  
AND e.employeefirstname LIKE :employeefirstname  
AND e.employeetype LIKE :employeetype  
AND e.vaccineprovider LIKE :vaccineprovider  
AND e.immunitystatus LIKE :immunitystatus  
AND( e.emloyeeno = employeeno OR e.employeeno IS NULL)  
AND( e.iqamano = iqamano OR e.iqamano IS NULL)  
ORDER BY e.persistenceId DESC

where employeeno and iqamano are Integer and all others are string  
Not able to get the data from buisness model when any integer attribute is added

---

<div class="post-metadata">

**Author:** ![romain.bioteau](https://dub1.discourse-cdn.com/flex013/user_avatar/community.ofelia.com/romain.bioteau/32/720_2.png) [@romain.bioteau](https://community.ofelia.com/u/romain.bioteau)\
**Post date:** [28 July 2021 11:33 UTC](https://community.ofelia.com/t/how-to-get-data-from-bdm-when-we-have-integer-and-string-both-kinds-of-data-types/10863/2 "2021-07-28T11:33:04Z")

</div>

Like explained in the [documentation](https://documentation.bonitasoft.com/bonita/2021.1/bdm-api#_businessdataquery), you need to pass the parameters to your query using the `f` parameter like this:

`http://localhost:8080/bonita/API/bdm/businessData/com.company.model.Employee?q=query1&p=0&c=10&f=positionemp=value&f=department=value...`

HTH  
Romain

---

<div class="post-metadata">

**Author:** ![romain.bioteau](https://dub1.discourse-cdn.com/flex013/user_avatar/community.ofelia.com/romain.bioteau/32/720_2.png) [@romain.bioteau](https://community.ofelia.com/u/romain.bioteau)\
**Post date:** [28 July 2021 08:41 UTC](https://community.ofelia.com/t/how-to-get-data-from-bdm-when-we-have-integer-and-string-both-kinds-of-data-types/10863/3 "2021-07-28T08:41:10Z")

</div>

Did you miss the `:` before the `employeeno` and `iqamano` parameters ?

Like this  
`
SELECT e
FROM Employee e
WHERE e.positionemp LIKE :positionemp
AND e.department LIKE :department
AND e.location LIKE :location
AND e.segement LIKE :segement
AND e.nationality LIKE :nationality
AND e.employeelastname LIKE :employeelastname
AND e.employeefirstname LIKE :employeefirstname
AND e.employeetype LIKE :employeetype
AND e.vaccineprovider LIKE :vaccineprovider
AND e.immunitystatus LIKE :immunitystatus
AND( e.emloyeeno = :employeeno OR e.employeeno IS NULL)
AND( e.iqamano = :iqamano OR e.iqamano IS NULL)
ORDER BY e.persistenceId DESC
`

---

<div class="post-metadata">

**Author:** ![azade](https://avatars.discourse-cdn.com/v4/letter/a/8baadc/32.png) [@azade](https://community.ofelia.com/u/azade)\
**Post date:** [28 July 2021 08:49 UTC](https://community.ofelia.com/t/how-to-get-data-from-bdm-when-we-have-integer-and-string-both-kinds-of-data-types/10863/4 "2021-07-28T08:49:53Z")

</div>

I tried the same query still not working, it's giving the error as mentioned below

"exception":&nbsp;"class&nbsp;org.bonitasoft.engine.command.CommandExecutionException",

&nbsp;&nbsp;&nbsp;&nbsp;"message":&nbsp;"USERNAME=walter.bates&nbsp;|&nbsp;org.bonitasoft.engine.command.SCommandExecutionException:&nbsp;org.bonitasoft.engine.business.data.SBusinessDataRepositoryException:&nbsp;parameter(s)&nbsp;are&nbsp;missing&nbsp;for&nbsp;query&nbsp;named&nbsp;query1&nbsp;:&nbsp;employeelastname,positionemp,employeetype,nationality,iqamano,employeefirstname,location,employeeno,department,segement,vaccineprovider,immunitystatus"

---

<div class="post-metadata">

**Author:** ![romain.bioteau](https://dub1.discourse-cdn.com/flex013/user_avatar/community.ofelia.com/romain.bioteau/32/720_2.png) [@romain.bioteau](https://community.ofelia.com/u/romain.bioteau)\
**Post date:** [28 July 2021 08:59 UTC](https://community.ofelia.com/t/how-to-get-data-from-bdm-when-we-have-integer-and-string-both-kinds-of-data-types/10863/5 "2021-07-28T08:59:54Z")

</div>

How do you call your query ?

---

<div class="post-metadata">

**Author:** ![azade](https://avatars.discourse-cdn.com/v4/letter/a/8baadc/32.png) [@azade](https://community.ofelia.com/u/azade)\
**Post date:** [28 July 2021 10:32 UTC](https://community.ofelia.com/t/how-to-get-data-from-bdm-when-we-have-integer-and-string-both-kinds-of-data-types/10863/6 "2021-07-28T10:32:17Z")

</div>

Fo this one I was checking in Postman

---

<div class="post-metadata">

**Author:** ![azade](https://avatars.discourse-cdn.com/v4/letter/a/8baadc/32.png) [@azade](https://community.ofelia.com/u/azade)\
**Post date:** [28 July 2021 10:32 UTC](https://community.ofelia.com/t/how-to-get-data-from-bdm-when-we-have-integer-and-string-both-kinds-of-data-types/10863/7 "2021-07-28T10:32:35Z")

</div>

Fo this one I was checking in Postman

---

<div class="post-metadata">

**Author:** ![romain.bioteau](https://dub1.discourse-cdn.com/flex013/user_avatar/community.ofelia.com/romain.bioteau/32/720_2.png) [@romain.bioteau](https://community.ofelia.com/u/romain.bioteau)\
**Post date:** [28 July 2021 10:41 UTC](https://community.ofelia.com/t/how-to-get-data-from-bdm-when-we-have-integer-and-string-both-kinds-of-data-types/10863/8 "2021-07-28T10:41:18Z")

</div>

And how do you pass the parameters in the query ?

---

<div class="post-metadata">

**Author:** ![azade](https://avatars.discourse-cdn.com/v4/letter/a/8baadc/32.png) [@azade](https://community.ofelia.com/u/azade)\
**Post date:** [28 July 2021 10:44 UTC](https://community.ofelia.com/t/how-to-get-data-from-bdm-when-we-have-integer-and-string-both-kinds-of-data-types/10863/9 "2021-07-28T10:44:10Z")

</div>

https://ibb.co/WD1xVvV

---

<div class="post-metadata">

**Author:** ![romain.bioteau](https://dub1.discourse-cdn.com/flex013/user_avatar/community.ofelia.com/romain.bioteau/32/720_2.png) [@romain.bioteau](https://community.ofelia.com/u/romain.bioteau)\
**Post date:** [28 July 2021 11:08 UTC](https://community.ofelia.com/t/how-to-get-data-from-bdm-when-we-have-integer-and-string-both-kinds-of-data-types/10863/10 "2021-07-28T11:08:38Z")

</div>

I mean, how do you pass the parameters when calling the query in postman ?

In your image:

- `employeelastname` is an Integer ?  
\*`iqamano` is a String ?

---

<div class="post-metadata">

**Author:** ![azade](https://avatars.discourse-cdn.com/v4/letter/a/8baadc/32.png) [@azade](https://community.ofelia.com/u/azade)\
**Post date:** [28 July 2021 11:16 UTC](https://community.ofelia.com/t/how-to-get-data-from-bdm-when-we-have-integer-and-string-both-kinds-of-data-types/10863/11 "2021-07-28T11:16:37Z")

</div>

AHH ! That was just by mistake  
In Postman I am just using GET method&nbsp;  
http://localhost:8080/bonita/API/bdm/businessData/com.company.model.Employee?q=query1&p=0&c=10

When I write a query SELECT e FROM Employee e and check on postman  
I get whole data&nbsp;https://ibb.co/tq2FzJ6

---

<div class="post-metadata">

**Author:** ![azade](https://avatars.discourse-cdn.com/v4/letter/a/8baadc/32.png) [@azade](https://community.ofelia.com/u/azade)\
**Post date:** [28 July 2021 14:53 UTC](https://community.ofelia.com/t/how-to-get-data-from-bdm-when-we-have-integer-and-string-both-kinds-of-data-types/10863/12 "2021-07-28T14:53:56Z")

</div>

Hello

just to simplify I added only 3 fields in the query&nbsp;https://ibb.co/Y3L7N5Q  
in the GET API I&nbsp;added the prameters  
http://localhost:8080/bonita/API/bdm/businessData/com.company.model.Employee?q=query2&p=0&c=10&f=department=Housing&f=nationality=Aruba&f=employeeno=123&nbsp;

https://ibb.co/CKhx7Jd

and now I am able to get the data in postman but not on my UI designer form&nbsp;https://ibb.co/k97bvyP
