⚙ Operations Hub

Zayne
Contributor

accessing the record ID of a created record

SOLVE

When I create a record using a workflow action, I want to be able to access the Record ID of that created record, so that I can use it in a custom code action and create an association between that record and another one. Is it possible to access this record ID? I've tried to use the 'format data' action, but I get 

 

Action is invalid: INVALID_REFERENCE_DATA_TYPE.

 

I can create the record using custom code, but I wanted to use the action that is already there.

1 Accepted solution
ChrisoKlepke
Solution
Key Advisor | Elite Partner
Key Advisor | Elite Partner

accessing the record ID of a created record

SOLVE

Hey @Zayne , 

 

thank you for reaching out to the community. 

 

You can't do that with the usual Create Record Action. But since you mentioned Custom Code Actions, you can also use these to create the record. With that method, you can save the response in a variable and get the ID in your output fields for further logic in your workflow. Or just create the record and do the association in one custom code action. All up to you!

 

Do you need some help to set that up?

 

Cheers, 

Chriso

View solution in original post

2 Replies 2
Zayne
Contributor

accessing the record ID of a created record

SOLVE

Thanks Christoph. I realise that I can do this via the custom code action, and I have indeed done it that way in the end.

What I'm confused about is why I can access the output of the "Create Record" action in a following "Format data", but when I try to do so, I get this error. If you can't actually use this output, why is it even available? 

0 Upvotes
ChrisoKlepke
Solution
Key Advisor | Elite Partner
Key Advisor | Elite Partner

accessing the record ID of a created record

SOLVE

Hey @Zayne , 

 

thank you for reaching out to the community. 

 

You can't do that with the usual Create Record Action. But since you mentioned Custom Code Actions, you can also use these to create the record. With that method, you can save the response in a variable and get the ID in your output fields for further logic in your workflow. Or just create the record and do the association in one custom code action. All up to you!

 

Do you need some help to set that up?

 

Cheers, 

Chriso