awork-io / awork

The awork Github repo supports you with awork integration and api questions. Here you can find links to further documentation, a FAQ with the most frequently asked questions and great code examples to get started even faster.
https://www.awork.com
11 stars 0 forks source link

[Question]: Is it possible to find a company by name? #148

Closed julianwitzel closed 1 year ago

julianwitzel commented 1 year ago

What is your question?

Hey, it's me again!

I was wondering if it is possible to find a company by name. In make.com I don't find this option. There is only "Get company" and it returns a list of all companies. Our automation is dynamic and the company name originates from a form on our intranet website.

For example: If a company that exists already in awork is called "Testcompany Inc." and I have a value "Testcompany" from my form, how can I find the company since the name is not exactly equal. Is there a way to search for a match in the string so that it still counts as "exists already"?

I built a similar automation for Google Drive. There we also check if the folder already exists by comparing the company name strings from the form and the actual folder name.

Bildschirmfoto 2023-09-12 um 16 10 32

I hope you get my question since it is not so easy to explain.

Do you have a trace id of the call?

No response

nilzzzzzz commented 1 year ago

Hi @julianwitzel ,

sure. You need to do a custom request with make and then do a call to https://api.awork.com/api/v1/companies?filterby=name eq '{YOURNAME}'

julianwitzel commented 1 year ago

Ok, that is already a good hint.

Now I get this response:

Bildschirmfoto 2023-09-12 um 16 19 20
nilzzzzzz commented 1 year ago

do you see a trace id? I think its visible somewhere in the ui.

julianwitzel commented 1 year ago

I was checking but I don't see something...

nilzzzzzz commented 1 year ago

I found this trace for you: companies?filterby=Test . This is not correct, you need to have companies?filterby=name eq 'test'

julianwitzel commented 1 year ago

Ahhhh ok, my bad. Thank you!

Look, I made 3 tests to find the company "REPERA GmbH" in awork:

  1. Input: REPERA GmbH

    Bildschirmfoto 2023-09-12 um 16 37 43
  2. Input: Repera GmbH

    Bildschirmfoto 2023-09-12 um 16 38 12
  3. Input: Repera

    Bildschirmfoto 2023-09-12 um 16 38 28

In the third case it does not find the company.

I did the same test in my awork dashboard and there it works.

Bildschirmfoto 2023-09-12 um 16 40 59

Do I need to put in some additional params?

nilzzzzzz commented 1 year ago

the eq filters for equality. Here you see the other possibilities: https://developers.awork.com/filtering

julianwitzel commented 1 year ago

Perfect! Thank you so much for your help :)