Would anyone have any idea how to set this up?

Hey everyone,

So one thing I’ve never understood too well is what I’m supposed to do when I get this dropdown? Whatever I seem to choose, it always leads to more and more options, never making the workflow valid.

Essentially, I’m connected to an API which is supposed to return a LinkedIn URL, Twitter user id and username, but all 3 are red and I’m not sure what to set in order to turn them blue.

Can anyone help with this?

Thanks,
Mohamad

image

Normally when these are red, its because the type of thing that you are setting the data to is either

  1. The incorrect data type or
  2. You are trying to set a singular thing to a list of things or vise versa

Check what types “twitter username” and “twitteruserid” are under the data tab on the left, then without clicking on it, hover over the red text and see what description appears. It should say something like “Evaluates to a…”

If the type of data and the expression for what it evaluates to does not match, bubble will keep these red.

Take some more screenshots of what I described above, I can walk you through this

Thanks, hope this helped

1 Like

In addition to what Anthony said, hover your mouse over “profile’s username” or “profile’s userid” and it will tell you what it evaluates to. If it says “evaluates to a text” then go back to yoru database setup where the field is “Twitter username” and see if Twitter username is set to text or a list of texts. If it is set to “text” then that is the reason you are getting the red. You will need to choose one of the items in that list in your screenshot that stars with a colon (i.e. “:”) such as first item. It could be that the api returns a list and you need to pick a particular item from that list. If the first item is not what you want, pick “:item #” to specify the nth item. Or you might need to filter the list

2 Likes

Hey Anthony, thanks for this - Paul too below.

Really helpful answers which I’ll give a try.

The only problem is that the data I’m trying to show is from an API - so it’s not going to be a data field that we can check under the data tab on the left.

And the API would return fields that are different for every search, and sometimes some of the fields may be missing, or have more than 1 entry.

What sort of screenshots do you think would help explain this if I were to share more?

Thanks,
Mohamad

On the same screen as your screenshot in your post, hover over “Twitter username” The one in white text, and take a screenshot of what tooltip appears after you hover for a few seconds

Then Hover over “username” in the red part from the API call. Thats the “FC API - ALL Contact Info’s profiles’s username” but just hover over the word “username” and take a screenshot of the little tooltip box that appears

Hey Anthony, so the first thing in terms of hovering on ‘Twitter Username’ doesn’t enable anything to happen. When I hover on that white text ‘Twitter Username,’ nothing happens.

But here is what comes up when I hover over the red text ‘Username’:

image

So it looks like Twitter username in white is of type text and “FC API - ALL Contact Info’s profiles’s username” is a list of text

You are trying to set a singular value of “Twitter username” to a list of values. And this is why your expression is red

As a simple example, click on the “more…” drop down and select “:first item” from the drop down. This will turn your expression blue

If the API call returns a list of usernames, and you need to save them, you either need to make “Twitter username” in white a list of texts in the data tab, OR you need to “schedule an api workflow on a list” on the list that the API returns

There’s good youtube tutorials on this, check this one out

Thanks, I’ll give this a shot.

I just wanted to add that the API providers said their API works on a POST request not GET.

So I’m not sure if I can get data back using a POST request right?

Would you know anything about this?

Thanks,
Mohamad

You actually can get data back via a post request, it just depends on however the API provider is exposing its API, and how they are handling requests.

Which doesn’t make intuitive sense, because you aren’t "GET"ing anything, you are "POST"ing, but simply put yes. It is possible to get data back with a POST

Alright that makes sense then - I’ll see what I can do. Because most YT videos I’ve watched so far don’t cover any APIs that are similar to the one I’m currently using which is a shame so the videos are pretty much useless.

I’ll check out the one you sent previously though.

Thanks.

P.s. For anymore support - is it cool if I just come and drop a message here?

1 Like

Hey Anthony, if I want to save the outputs received from the API, do I just make a new data type with all the fields I’d like to save - such as Twitter, LinkedIn etc?

Then in the workflows, do I create a new thing making each field equal to the repeating groups information or do I make it equal to the data being pulled from the API?

image

I’m attaching this screenshot above because I think it can explain it better - both options turn blue, but one is equal to the RG data and the other is equal to the ‘get data from external API.’

Thanks,
Mohamad

P.s. I’ve changed the API name - so that’s why it may look different

Actually, both ways will yield to the same value,

It depends on your use case. If the user interacts with the repeating group in ways to change the data, then do it from the repeating group.

If you just purely need to save the response from the API call, then save it directly from the API

Users will be able to input a piece of information then the output will be shown on the RG - but they would also need to save it.

I’m thinking that both options would work here, or should I just go for the RG as the option?

Thanks

If they are interacting with a save button on the screen, use the RG data

Hey Anthony, thanks for all the help so far - I finally managed to set up the API and every time I input something, the output is saved in a data set which is good.

But now we’re facing another issue.

The data is supposed to show up in a repeating group but for some reason we can’t get the RG to show any information even though the call is coming back with some info.

image

I feel it’s because of the data source being empty but in order to fill the data source I need a return value like this:

My data that I want to display does not have a list, it looks like this:

I hope this makes sense and that you could help!

Thanks again,
Mohamad

You make the repeating group the type of the API response, then in your repeating group, add a text element and make the text elements source " current cells body fullName"