Yes / no convert to true / false

HI !

I got a problem, i’m using the “intercom” API with API connector to create a contact with custom_attributes.
the probleme is this custom_attributes wait a boolen (true / false) but Bubble only permit me to send a yes / no by using checkbox is checked.
is there a solution to convert those yes / no to true / false.


Screenshot_2

I think this is just a matter of nomenclature.

Yes/No, 0/1, True/False… it’s all the same.

If you are sending boolean type data and the API receives this data as boolean as well, it should work.

What error are you encountering?

there is no error , when i use my api call in the workflow , i see with step-by-step run that my yes/no data are send but in Intercom all the parameters are set as true even if i set them on no.

in this pic you can see that i put “cpt_acces = non ( no / false)”

image

but in this pic the params acces is still set as true.

Is the documentation for this API you are trying to integrate public? Would you be able to post the link?

sure, here it is : Create contact

1 Like

One method that I’ve done before is after your expression, add :format as text and for yes, true, for no, false. That’s solved this problem for me in the past.

1 Like

ok so i created a custom state in text type that change is value on input checkbox is check or not and i send the value of this custom state as a text instead of a boolean, and it worked …

i also tried to :format as text and it also worked.

so it look like intercom API don"t accept boolean or somehting like that … i don’t know.

thank you for your help guys !

2 Likes

So, apparently, the data that the API expects to receive for these fields is a string and not a boolean.

great that it solved!

This topic was automatically closed after 70 days. New replies are no longer allowed.