Help required with If function

Hello,

I feel like this should be so simple but clearly I am missing something / doing something wrong!

I have an API that retrieves a ‘client tag’ from my data source. I want to add that to a Google Sheet as a more simplified tag. If the tag is staff, show staff, if it’s volunteer, show volunteer, if it’s anything else show member.

This is the formula I am trying to use in the ‘Google Sheets - add a row’ module:

This is the type of data the API returns:

image

In this case, I want the spreadsheet to say “Member” but it returned “Staff”.

Typically there is only one tag, the above is not a great example! If there are multiple tags it would only ever be ones that all mean ‘member’.

I asked the AI assistant and it suggested:

but that just threw and error and stopped the scenario completely:

Any help would be much appreciated.

Many thanks!

Jayne

I managed to figure it out!

Because the data returned is an array I needed to use ‘contains’, my formula ended up looking like this:

Sharing in case anyone has a similar issue in the future! :smiley:

2 Likes

Hello @Jayne_Smith :waving_hand:

Amazing!! Thank you for coming back and sharing the solution. :hugs:

Happy automating!

Turns out this wasn’t working like I thought! It is marking everything as ‘Member’ even when the array only contains ‘Staff’.

I would really appreciate any help anyone can offer!

Many thanks,

Jayne

I was nearly there, I had my ; in the wrong place. The correct formula syntax is below if anyone hits a similar issue in future:

2 Likes