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.
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!
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?
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!