Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

podio get_basic_by_field not work #187

Open
mehermakloufi opened this issue Mar 19, 2020 · 4 comments
Open

podio get_basic_by_field not work #187

mehermakloufi opened this issue Mar 19, 2020 · 4 comments

Comments

@mehermakloufi
Copy link

I want to fetch podio data using field_id and item_id . I use this function and it does not work for me :

$fild_value = PodioItem::get_basic_by_field( $item_id, $field_id );

And output is : "PodioBadRequestError (1) PodioBadRequestError" .

@rafaelmb
Copy link
Member

A bad request usually is something wrong with the data you are sending; Please check item_id and field id and try again

@mehermakloufi
Copy link
Author

A bad request usually is something wrong with the data you are sending; Please check item_id and field id and try again

I try since this morning and the same problem, though item_id and field_id as true

@mehermakloufi
Copy link
Author

and my real probleme is :

I fetch data from podio CRM using PHP language and I fetch data for each element via its id as it is found in this function:

public function getContacts($item_id) {

$this->contactAuth();

$item = \PodioItem::get_by_app_item_id($podio_contact_app_id,$item_id);
  return $item;

}

For example we have the 'Status' we show it like this:

$status = $item->fields[6]->values;

Not all elements get it right though it is the same function.

Sometimes :

$status = $item->fields[6]->values;

and sometimes :

$status = $item->fields[8]->values;

I tried to access data via a function : get_basic_by_field() but it did not work

What is the simplest solution to these problems?
Can we know what caused the problem?

@rafaelmb
Copy link
Member

Yeah that looks dangerous, get a field value by it's array position.

Can you try changing it to the external_id ? It's the second best (the best is field_item_id but that is annoying to use specially in multiple environments)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants