*ConvertDatetoDatetimeFlowAction.cls* - When called from a flow doesn't bulkify properly and sets bad data if used from an import
How to use GitHub
- Please use the 👍 reaction to show that you are affected by the same issue.
- Please don't comment if you have no relevant information to add. It's just extra noise for everyone subscribed to this issue.
- Subscribe to receive notifications on status change and new comments.
Steps to reproduce
- Create a record triggered flow that calls this action: https://unofficialsf.com/convert-date-to-datetime-flow-action/
- Trigger the flow for multiple records at once using an import.
- The value calculated for the last record through will be saved for all records.
Expected behaviour
It should properly save the right value for each record.
Actual behaviour
It saves the value of the last record through on all records.
Line 46 needs to be moved inside the for loop. Then it works properly.
@ericrsmith35 I was getting flow errors because one of the dates needed to be before the other, and I have a validation to enforce that. I debugged the flow and found that the date to datetime conversion output was giving unexpected results.
For Example, 4/8/2021 got output as 4/27/2021
I came here to see if this had been reported and found this open issue. I tested the proposed solution of moving the response variable inside the for loop and re-tested the flow that was throwing errors, and all of the records were processed without any errors this time.
I created PR #1459 to patch this issue, but it needs to be reviewed since I am not a contributor.