Using the Compose Records Search function

I’m trying to get a Compose Record as a resource to use in my workflow, but I seem to be having some trouble using it once I get it. Here’s what I’ve got on the diagram:

I try to access the resulting record (named currentRankRecord) using the expression that immediately follows the function, but it doesn’t want to work. I’m trying to pull currentRankRecord.values.memberRankEffectiveDate with the expression, but I get this:

Am I missing something?

1 Like

Since the error happens in the expression, that’s what you need to share.
From the error it seems you’re trying to add int values, when they should be strings.

I’m not trying to add anything - I’m just trying to get a date off of the record:

Does the record search function return things in an array, by any chance?

1 Like

Yes, they’re in an array. You can use the find by ID (or lookup, forgot what it’s called) to get just the one off the bat. Else, just pick it from the array.

@colby.ritter - Hi! I’m struggling with what looks to be the same thing. I can see that the search function is pulling back 1 record, but I can’t figure out how to reference that one compose record (like you seem to be trying to do in your last screenshot). Were you able to over come this issue? Thank you in advance!

@tjerman any additional guidance would be awesomely appreciated! Attached is a snapshot of my set-up. It’s a very basic test of Compose Search. Thank You!

While you limited the number of results to 1, your variable “delInfo” is still an array.

What I would do is change the name of the variable in the result of the function block to: delInfoArray.

Then, add an expression block with the expression:

Now your prompt will work.

1 Like

@Lenny - Thank You! That’s crazy helpful! I had never used the Type Compose Record in an expression, but this makes complete sense.

Hi @Lenny,

I also wish to do the same thing. The only difference is that I want to display particular data in a text field.

Is it possible to accomplish that?

@Lenny Apologies for the quick follow-up, but I’m running into another Compose Search issue. This time it’s all about dates. Below you’ll see the query and the error. Both parameters are set-up as DateTime. I’m sure I’m doing something wrong on the formatting side, and forgive me if this is a noob question :slight_smile: