I have a form that collects vins and other info from users. These users need to be able to list an unlimited number of vins, so I'm using a multi-line property to allow them to input as many as needed (one per line).
Here's the thing, we use vin as the unique identifier of our custom object "Vehicles". I need a way to separate the multi-line field into individual vins, and create a Vehicle record for each. I know that with custom coded actions I can parse through the collected vins and add them to a list, but is it possible to create a Vehicle record for each within the same action?
This is the code that ended up working for me. I just got rid of the context. Also, turns out, when you use test action in a custom coded action it can't fetch associated object properties, so I had to test the whole workflow for it to pull all the information. But it works! Hopefully this helps someone else in the future.
Attached is the code I've pulled together. I'm getting this lambda error:
LAMBDA_WARNING: Unhandled exception. The most likely cause is an issue in the function code. However, in rare cases, a Lambda runtime update can cause unexpected function behavior. For functions using managed runtimes, runtime updates can be triggered by a function change, or can be applied automatically. To determine if the runtime has been updated, check the runtime version in the INIT_START log entry. If this error correlates with a change in the runtime version, you may be able to mitigate this error by temporarily rolling back to the previous runtime version. For more information, see https://docs.aws.amazon.com/lambda/latest/dg/runtimes-update.html [ERROR] TypeError: main() missing 1 required positional argument: 'context' Traceback (most recent call last): File "/var/task/hubspotHandler.py", line 6, in hubspot_handler return file.main(event)
This is the code that ended up working for me. I just got rid of the context. Also, turns out, when you use test action in a custom coded action it can't fetch associated object properties, so I had to test the whole workflow for it to pull all the information. But it works! Hopefully this helps someone else in the future.